This note pertains to R:Base for Windows 6.5++. Any enlightening comments
would be appreciated.
==================================================
Keymap (from R:Syntax):
You can define keymaps with a single statement,
which is similar to defining keymaps using the
Define a Keymap option from the Utilities menu
in R:BASE for Windows You can also define
keymaps in command files. For example:
SET KEYMAP [SHIFT][F3] TO [F2]
SET KEYMAP [ALT]M= [F2]
To return to the original key mapping, enter
the following:
SET KEYMAP [ALT]M OFF
To clear all keymaps at once you may now use the
SET KEYMAP ALL OFF. This will clear all defined keymaps.
To retrieve the value of a particular keymap
use the GETKEY function.
==================================================
When a KEYMAPped key is pressed in RBWin TWO keypresses are put into the
type buffer. One becomes the current key and the second is the first
keypress in the typeahead portion of the buffer. For example in the
following code "[F4]" is returned in vt and "[F8]" in vx when LASTKEY is
used with the arguments shown. Then because there is another keypress in
the typeahead buffer "[F8]" is returned in a second loop iteration in both
vt and vx. The second keypress must be disposed by processing it in some
fashion as it will become the next keyboard response processed if not
eliminated. GETKEY is probably the easiest. Note that KEYMAPped keypresses
and the LASTKEY function perform somewhat differently between the DOS and
Windows versions of RBase.
-------------------------------------
SET KEYMAP [F8] OFF
SET KEYMAP [F8] = [F4]
WHILE 2 > 1 THEN
FILLIN vy=0 USING 'vy:'
SET VAR vt = (LASTKEY(0))
SHO VAR vt
SET VAR vx = (LASTKEY(1))
SHO VAR vx
IF vt = '[Esc]' THEN
Break
ENDIF
ENDWHILE
-------------------------------------
Output when [F8] is pressed:
vy:
[F4]
[F8]
vy:
[F8]
[F8]
-------------------------------------
TIA,
Bernie