This page describes remapping keys in HDSterm along with some examples
of these remappings.
Sample Key Translations
To customize the keyboard translations, you must first determine
which keyset the keys you wish to change belong to. Keys that belong
to one of the special sets can be redefined as part of the set. Keys
that do not belong to a special set can be redefined with normal key
override translations.
If the key to be redefined is not in one of the special sets,
you can simply use the "*screen.translations" resource. Note that some
keys have special definitions in the Motif widget set, such as F1, F4,
and F10 (see the following table). If you use these keys you must refer
to them by that name in the translation table. In the special case of
F10, which is an accelerator key, you must explicitly disable the key
before you redefine it in order to disable the accelerator function,
which normally overrides the key translation (an example is given
below).
For ordinary keys, you can just redefine them; for instance,
the Backspace key on an IBM keyboard, designated as osfBackSpace, often
needs to be remapped to the Delete key for DEC applications. Since this
key doesn't appear in any keyset group, you can use a normal screen
translation, such as (but note the use of the osfBackSpace name for the
keysym): HDSTerm*screen.translations: #override \
<Key>osfBackSpace: key-input("\177")
If the key
you want to redefine does occur in one of these keyset groups, you must
use the entire keyset in your translation. This is necessary because
your new key set resource definition completely replaces the built-in
default for that resource. Therefore, you may not use an "#override"
directive and simply list only those keys you want changed. Rather,
you must include all keys which have translations defined in the
built-in defaults. For keys not found in the special sets, you may use
the "#override" directive on the *screen.translations resource, as
these are applied at widget initialization.
For example, if you want Shift-F9 to generate "cd $HOME" and
F10 to function as a normal function key instead of the osfMenuBar, you
would have to replace the entire "*term.vt220-auxTrans-fkeys" resource.
In the example below, this definition is added for the Shift-F9 key.
Note that the unshifted F9 must now be explicitly prefaced by ~Shift
(this means "not Shift") and the beginning colon removed (the colon
used with other keys means "ignore modifier keys"). The F10 key first
must have the accelerator function disabled by entering a null value,
and is then remapped in the normal way. Note the use of the osf key
binding names instead of the normal keysyms.
! this sets the osfMenuBar key (F10) to a null value
HDSTerm*menuBar.menuAccelerator: ""
HDSTerm*term.vt220-auxTrans-fkeys:
\
~Shift <Key>osfHelp: key-input("Ctrl-[[11~")\n \
Shift <Key>osfHelp:
key-input("Ctrl-[[25~")\n \
:<Key>F2: key-input("Ctrl-[[12~")\n \
:<Key>F3: key-input("Ctrl-[[13~")\n \
:<Key>osfMenu:
key-input("Ctrl-[[14~")\n \
:<Key>F5:
key-input("Ctrl-[Ctrl-[[15~")\n \
:<Key>F6:
key-input("Ctrl-[[17~")\n \
:<Key>F7: key-input("Ctrl-[[18~")\n \
:<Key>F8: key-input("Ctrl-[[19~")\n \
~Shift <Key>F9:
key-input("Ctrl-[[20~")\n \
Shift <Key>F9: key-input("cd
$HOME")\n \
Shift <Key>osfMenuBar: key-input("Ctrl-[[22~")\n \
:<Key>F11: key-input("Ctrl-[[23~")\n \
:<Key>F12:
key-input("Ctrl-[[24~")\n \
:<Key>F13: key-input("Ctrl-[[25~")\n
\
:<Key>F14: key-input("Ctrl-[[26~")\n \
:<Key>F15:
key-input("Ctrl-[[28~")\n \
:<Key>Help: key-input("Ctrl-[[28~")\n
\
:<Key>F16: key-input("Ctrl-[[29~")\n \
:<Key>Menu:
key-input("Ctrl-[[29~")\n \
:<Key>F17: key-input("Ctrl-[[31~")\n
\
:<Key>F18: key-input("Ctrl-[[32~")\n \
:<Key>F19:
key-input("Ctrl-[[33~")\n \
:<Key>F20: key-input("Ctrl-[[34~")\n
\
:<Key>KP_F1: key-input("Ctrl-[OP")\n \
:<Key>KP_F2:
key-input("Ctrl-[OQ")\n \
:<Key>KP_F3: key-input("Ctrl-[OR")\n \
:<Key>KP_F4: key-input("Ctrl-[OS")\n \
HDSTERM
DEFAULT TRANSLATION DEFINITIONS
Note: The default MOTIF key bindings are used, so the following
standard X Windows keysyms must be replaced by their MOTIF bindings in
any event translation resources:
/* X KeySym MOTIF KeySym */
/* Escape osfCancel */
/* Left osfLeft */
/* Up osfUp */
/* Right osfRight */
/* Down osfDown */
/* End osfEndLine */
/* Home osfBeginLine */
/* Prior osfPageUp */
/* Next osfPageDown */
/* BackSpace osfBackSpace */
/* Delete osfDelete */
/* Insert osfInsert */
/* F1 osfHelp */
/* F4 osfMenu */
/* Shift F8 osfAddMode */
/* F10 osfMenuBar */
/* Select osfSelect */
/* KP_Enter osfActivate */
/* Clear osfClear */
/* Undo osfUndo */
/* Application Keypad */
*term.vt220-auxTrans-appKeypad: \
/* Group 1 */ \
:<Key>KP_0: key-input("Ctrl-[Op")\n \
:<Key>KP_1: key-input("Ctrl-[Oq")\n \
:<Key>KP_2: key-input("Ctrl-[Or")\n \
:<Key>KP_3: key-input("Ctrl-[Os")\n \
:<Key>KP_4: key-input("Ctrl-[Ot")\n \
:<Key>KP_5: key-input("Ctrl-[Ou")\n \
:<Key>KP_6: key-input("Ctrl-[Ov")\n \
:<Key>KP_7: key-input("Ctrl-[Ow")\n \
:<Key>KP_8: key-input("Ctrl-[Ox")\n \
:<Key>KP_9: key-input("Ctrl-[Oy")\n \
/* Group 2 */
:<Key>KP_Decimal: key-input("Ctrl-[On")\n \
:<Key>KP_Subtract: key-input("Ctrl-[Om")\n \
:<Key>KP_Separator: key-input("Ctrl-[Ol")\n \
Alt <Key>KP_Add: key-input("Ctrl-[l")\n \
:<Key>osfActivate: key-input("Ctrl-[OM")\n
/* Numeric Keypad */
*term.vt220-auxTrans-numKeypad: \
/* Group 1 */ \
:<Key>KP_0: key-input()\n \
:<Key>KP_1: key-input()\n \
:<Key>KP_2: key-input()\n \
:<Key>KP_3: key-input()\n \
:<Key>KP_4: key-input()\n \
:<Key>KP_5: key-input()\n \
:<Key>KP_6: key-input()\n \
:<Key>KP_7: key-input()\n \
:<Key>KP_8: key-input()\n \
:<Key>KP_9: key-input()\n \
/* Group 2 */
:<Key>KP_Decimal: key-input()\n \
:<Key>KP_Subtract: key-input()\n \
:<Key>KP_Separator: key-input()\n \
Alt<Key>KP_Add: key-input(",")\n \
:<Key>osfActivate: key-input()\n
* Application Cursor Keys */
*term.vt220-auxTrans-appCKeys: \
~Shift <Key>osfLeft: key-input("Ctrl-[OD")\n \
~Shift <Key>osfRight: key-input("Ctrl-[OC")\n \
~Shift <Key>osfDown: key-input("Ctrl-[OB")\n \
~Shift <Key>osfUp: key-input("Ctrl-[OA")\n
/* Normal Cursor Keys */
*term.vt220-auxTrans-normCKeys: \
~Shift <Key>osfLeft: key-input("Ctrl-[[D")\n \
~Shift <Key>osfRight: key-input("Ctrl-[[C")\n \
~Shift <Key>osfDown: key-input("Ctrl-[[B")\n \
~Shift <Key>osfUp: key-input("Ctrl-[[A")\n
/* Function Keys */
*term.vt220-auxTrans-fkeys: \
:<Key>osfHelp: key-input("Ctrl-[[11~")\n \
:<Key>F2: key-input("Ctrl-[[12~")\n \
:<Key>F3: key-input("Ctrl-[[13~")\n \
:<Key>osfMenu: key-input("Ctrl-[[14~")\n \
:<Key>F5: key-input("Ctrl-[[15~")\n \
:<Key>F6: key-input("Ctrl-[[17~")\n \
:<Key>F7: key-input("Ctrl-[[18~")\n \
:<Key>F8: key-input("Ctrl-[[19~")\n \
:<Key>F9: key-input("Ctrl-[[20~")\n \
:<Key>F10: key-input("Ctrl-[[21~")\n \
:<Key>F11: key-input("Ctrl-[[23~")\n \
:<Key>F12: key-input("Ctrl-[[24~")\n \
:<Key>F13: key-input("Ctrl-[[25~")\n \
:<Key>F14: key-input("Ctrl-[[26~")\n \
:<Key>F15: key-input("Ctrl-[[28~")\n \
:<Key>Help: key-input("Ctrl-[[28~")\n \
:<Key>F16: key-input("Ctrl-[[29~")\n \
:<Key>Menu: key-input("Ctrl-[[29~")\n \
:<Key>F17: key-input("Ctrl-[[31~")\n \
:<Key>F18: key-input("Ctrl-[[32~")\n \
:<Key>F19: key-input("Ctrl-[[33~")\n \
:<Key>F20: key-input("Ctrl-[[34~")\n \
:<Key>KP_F1: key-input("Ctrl-[OP")\n \
:<Key>KP_F2: key-input("Ctrl-[OQ")\n \
:<Key>KP_F3: key-input("Ctrl-[OR")\n \
:<Key>KP_F4: key-input("Ctrl-[OS")\n
/* IBM -> VT Remap Function Keys */
*term.vt220-auxTrans-ibmFkeys: \
:<Key>osfHelp: key-input("Ctrl-[OP")\n \
:<Key>F2: key-input("Ctrl-[OQ")\n \
:<Key>F3: key-input("Ctrl-[OR")\n \
:<Key>osfMenu: key-input("Ctrl-[OS")\n
/* Misc. Function Keys (editing keys) */
*term.vt220-auxTrans-miscFkeys: \
~Shift<Key>Find: key-input("Ctrl-[[1~")\n \
~Shift <Key>osfInsert: key-input("Ctrl-[[2~")\n \
~Shift <Key>DRemove: key-input("Ctrl-[[3~")\n \
~Shift <Key>osfSelect: key-input("Ctrl-[[4~")\n \
~Shift <Key>osfPageUp: key-input("Ctrl-[[5~")\n \
~Shift <Key>osfPageDown: key-input("Ctrl-[[6~")\n \
~Shift <Key>osfBeginLine: key-input()\n \
~Shift <Key>osfEndLine: key-input()\n \
~Shift <Key>osfDelete: key-input()\n
/* IBM -> VT Remap Misc. Function Keys (editing keys) */
*term.vt220-auxTrans-ibmMiscFkeys: \
~Shift <Key>osfInsert: key-input("Ctrl-[[1~")\n \
~Shift <Key>osfBeginLine: key-input("Ctrl-[[2~")\n \
~Shift<Key>osfPageUp: key-input("Ctrl-[[3~")\n \
~Shift <Key>osfDelete: key-input("Ctrl-[[4~")\n \
~Shift <Key>osfEndLine: key-input("Ctrl-[[5~")\n \
~Shift <Key>osfPageDown: key-input("Ctrl-[[6~")\n
/* Redefine function keys for use with Telnet, to provide DISPLAY variable */
/* osfMenuBar is XK_F10, osfCancel is XK_Escape */
*term.vt220-auxTrans-telnetFkeys: \
Alt~Ctrl~Shift<Key>osfMenuBar: key-input("set display/create/server=0/")
key-input("trans=tcpip/node=")
call-parser(10,"")
key-input(\015) \n\
Alt~Ctrl~Shift<Key>F11: key-input("DISPLAY=")
call-parser(10,"")
key-input(":0;export DISPLAY")
key-input(\015) \n\
Alt~Ctrl~Shift<Key>osfCancel: key-input("DISPLAY=")
call-parser(10,"")
key-input(":0;export DISPLAY")
key-input(\015) \n\
Alt~Ctrl~Shift<Key>F12: key-input("setenv DISPLAY ")
call-parser(10,"")
key-input(":0")
key-input(\015) \n\
Return to Section Heading Page
Return to the Home Page
If you need more information than is available here, you can reach
HDS via email at info@hds.com, or
call us at 1.800.HDS.1551 in the USA, or at +610.277.8300 from outside
the US. For questions or problems regarding the HDS WWW page, contact
webmaster@hds.com.
© 1996 by HDS Network Systems
Inc.