/***
:) Mozart? No, I think not. HE knew what he was doing. :) Me? I just
muddle along and hope.
I guess I've been doing this since around 2002 or so. The folks here
have been very helpful and every now and then I see something to try.
Anyway, here is a more complete cursor movement macro that includes
other cursor movement keys. I seem to recall that you are using the
WordStar .ui file, so I set the assigned keys for cursor movement to it.
If your .ui is not WordStar, this is easily changed.
Also let me know if any of the keys do not work the way you expect. If
there are any other keys that might benefit from this macro, let me
know.
Just compile the macro and execute it to activate all the keys. Purge
the macro to return the key definitions to their original values.
I think you can add it to your AutoLoad list if it is useful.
By the way, you might look at the last two assigned keys. These are the
ones I use to QuitFile and Exit and they do help prevent keystroke
confusion. :)
***/
proc mcursor(integer i)
case i
when 1 // cursor right
if currcol()>currlinelen() if down() begline() else endline() endif
endif
when 2 // cursor left
if currcol()==1 and up() endline() endif
when 3 // cursor up
if currcol()>currlinelen() endline() endif
when 4 // cursor down
if currcol()>currlinelen() endline() endif
when 5 // other movements
if currcol()>currlinelen() endline() endif
endcase
end
// wordstar ui movement key assignments
<CursorLeft> Left() mcursor(2)
<Ctrl s> Left() mcursor(2)
<CursorRight> Right() mcursor(1)
<Ctrl d> Right() mcursor(1)
<CursorUp> Up() mcursor(3)
<Ctrl e> Up() mcursor(3)
<CursorDown> Down() mcursor(4)
<Ctrl x> Down() mcursor(4)
<Ctrl CursorUp> ScrollUp() mcursor(5)
<Ctrl w> ScrollUp() mcursor(5)
<Ctrl CursorDown> ScrollDown() mcursor(5)
<Ctrl z> ScrollDown() mcursor(5)
<PgUp> PageUp() mcursor(5)
<Ctrl r> PageUp() mcursor(5)
<PgDn> PageDown() mcursor(5)
<Ctrl c> PageDown() mcursor(5)
<Ctrl Home> BegWindow() mcursor(5)
<Ctrl q><e> BegWindow() mcursor(5)
<Ctrl End> EndWindow() mcursor(5)
<Ctrl q><x> EndWindow() mcursor(5)
<Ctrl q><i> GotoLine() mcursor(5)
// quitfile and exit keys
<ctrl backspace> quitfile()
<alt backspace> exit()