======================================================================
REMAPPING THE KEYBOARD
======================================================================
PRODUCT: R:BASE VERSION : 4.0
AREA : KEYMAPS CATEGORY: REMAP DOCUMENT#: 656
======================================================================
R:BASE 4.0 has increased the number of keys that you can use to define
keymaps. You can now remap the following keys:
<> Alt-A through Alt-Z
<> Alt-0 through Alt-9
<> F1 through F10
<> Alt-F1 through Alt-F10
<> Ctrl-F1 and Ctrl-F3 through Ctrl-F10
<> Shift-F1 through Shift-F10
<> Ins, Home, Ctrl-Home, PgUp, Ctrl-PgUp, Del, End, Ctrl-End, PgDn,
Up, Down, Left, Ctrl-Left, Right, Ctrl-Right
To remap keys from within R:BASE, hold down the Ctrl key and press F1.
A menu that allows you to redefine the keyboard appears on screen.
Because of the broadened key definition capability, you now can redefine
keys that have special meaning to R:BASE. If you redefine PgUp, for
example, you can no longer use it at the R> prompt to display previous
commands. To undefine a key and return it to its original definition,
choose to define it but don't provide any keystrokes - simply press
Ctrl-F2 immediately after identifying the key to define.
The Command Dictionary entry under Keymaps also describes how to delete
a keymap.
Silently Remap Keys
===================
In R:BASE 4.0 you can now silently remap a key though a playback
(script) file so the user does not see the remapping of the key on
the screen. This works only to remap keys in a playback file; it does
not suppress display of other keystrokes in playback files. One place
to use the silent remapping of keys is to remap the PgUp and PgDn keys
before editing data with a form so that those keys can be used to move
up and down rows of data in addition to the F7 and F8 keys.
First create the playback files that will create and then delete the
keymaps. Create the keymaps as follows:
1. Press Ctrl-F1 and choose Record a script file. Enter a name for the
file, for example, pageon.pla. Script (playback) files are easy to
keep track of if you make the extension .PLA or .SCP.
2. Press Ctrl-F1 again (you're now recording keystrokes) and choose
Define a keymap. Select PgUp as the key to define. Enter F7 as the
key to map it to. If you enter F7 five times, the cursor will move
up five rows each time you press PgUp. Enter F7 as many times as
you have tiers in your region. When you have entered F7 enough
times, press Ctrl-F2 to stop defining the PgUp key.
3. Press Ctrl-F1 and choose Define a keymap again (you're still
recording keystrokes). Select PgDn as the key to define. Enter F8
as the key to map it to. If you enter F8 five times, the cursor
will move down five rows each time you press PgDn. Enter F8 as
many times as you have tiers in your region. When you have entered
F8 enough times, press Ctrl-F2 to stop defining the PgDn key.
4. Press Ctrl-F2 to stop recording. You now have a playback file that
redefines the keys PgUp and PgDn.
Create a playback file to return the PgUp and PgDn keys to their
original definition as follows:
1. Press Ctrl-F1 and choose Record a script file. Enter a name for the
file, for example, pageoff.pla.
2. Press Ctrl-F1 again and choose Define a keymap. Select PgUp as
the key to define. Immediately press Ctrl-F2 to end defining the
key. Press Ctrl-F1 and choose Define a keymap again. Select PgDn
as the key to define. Immediately press Ctrl-F2 to end defining the
key.
3. Press Ctrl-F2 to stop recording. You now have a playback file
that undefines the PgUp and PgDn keys and returns them to their
original R:BASE definitions (scroll through the keyboard buffer).
To use these playback files when editing a form, use the R:BASE editor
to create a small command file as follows:
PLAY pageon.pla
EDIT USING formname
PLAY pageoff.pla
The first line executes the playback file to define the PgUp and PgDn
keys. When editing data, you can then use these keys instead of F7 and
F8 to move through rows in a region. The last line executes the playback
file that turns off the definition of PgUp and PgDn. When you execute
this command file, you'll see the Ctrl-F1 menu appear on the screen
while the keys are being redefined. To turn off the display of the
Ctrl-F1 menu, edit the playback files.
The R:BASE editor can edit playback files; most other editors cannot.
A playback file is not an ASCII file<196>it contains keystroke codes
instead of ASCII characters. When you edit a playback file with RBEDIT,
you see "Reading file" and then the following message on the screen:
"The file contains characters that make it look like a script
file. To force editing the file as an ASCII file, press the Esc
key. To edit the file as a script file, press any other key."
Press any key to edit the file as a playback file.
The file pageon.pla looks like this:
[Ctrl][F1][Down][Down][Enter]
[PgUp][F7][F7][F7][F7][F7][Ctrl][F2][Ctrl][F1][Down][Down][Enter]
[PgDn][F8][F8][F8][F8][Ctrl][F2][Ctrl][F2]
The actual keystrokes are enclosed in square brackets ([]). To silently r
emap the keys, replace the Ctrl-F1 menu keystrokes ([Ctrl][F1][Down][Down][Ente
r]) with the [F11] key. The files should like the following screen when you ar
e done:
[F11]
[PgUp][F7][F7][F7][F7][F7][Ctrl][F2][F11]
[PgDn][F8][F8][F8][F8][F8][Ctrl][F2][Ctrl][F2]
Use the R:BASE editor to make the same changes to the file pageoff.pla.
When you are done and run the command file, the screen shows nothing
to indicate that the keys have been changed - the change is completely
transparent to the user.