Summary: xterm F-keys & Num keys

From: Jim Gottlieb (jimmy@denwa.info.com)
Date: Tue Jan 11 1994 - 18:05:06 CST


In article <2gakat$1uv@denwa.info.com> I wrote:
>
>One thing I'm desperately trying to do is get their numeric keypads and
>function keys working. For reference, we are using the xterm that
>comes with OpenWindows 3.0.

Several people asked me to pass on the answer, so here we go...

Although I have never seen reference to it in any manual, you can use
the @Num_Lock modifier to reference keys pressed when the NumLock is
on. Sun apparently released a patch that was just a new
/usr/openwin/lib/app-defaults/XTerm file and it was in there.

Here is the translations settings that we are now using. Note that you
will have to monkey with your xterm termcap and terminfo entries to get
them to match if you want to use the function key definitions we use.
At least they are close to vt100, unlike the default xterm ones.
Also note that all translations with a modifier must precede those
without. And of course, these won't take effect until you exit the
window system and restart or use xrdb to read them in.

We have only type-4 keyboards on our Suns. I don't know what would
need to be changed to make everything work on a type-5, though I would
like to know since our financial people complain about the lack of
separate cursor keys. I also modified this for use on our 386 machines
running X386 by substituting the following
Sun PC-AT
--- -----
R7 Home
R9 Prior
R13 End
R15 Next
and eliminating other references to Sun-only keys.

I still believe strongly that xterm as distributed should be more
vt-100-like in its key mapping.

XTerm*VT100.Translations: #override \
    @Num_Lock<Key>KP_0: string(0)\n\
    @Num_Lock<Key>KP_1: string(1)\n\
    @Num_Lock<Key>KP_2: string(2)\n\
    @Num_Lock<Key>KP_3: string(3)\n\
    @Num_Lock<Key>KP_4: string(4)\n\
    @Num_Lock<Key>KP_5: string(5)\n\
    @Num_Lock<Key>KP_6: string(6)\n\
    @Num_Lock<Key>KP_7: string(7)\n\
    @Num_Lock<Key>KP_8: string(8)\n\
    @Num_Lock<Key>KP_9: string(9)\n\
    @Num_Lock<Key>KP_Add: string(+)\n\
    @Num_Lock<Key>KP_Decimal: string(.)\n\
    @Num_Lock<Key>KP_Divide: string(/)\n\
    @Num_Lock<Key>KP_Enter: string(\015)\n\
    @Num_Lock<Key>KP_Equal: string(=)\n\
    @Num_Lock<Key>KP_Multiply: string(*)\n\
    @Num_Lock<Key>KP_Subtract: string(-)\n\
    <Key>KP_Enter: string(0x1B) string("OM") \n\
    <Key>F1: string(0x1B) string("OP") \n\
    <Key>F2: string(0x1B) string("OQ") \n\
    <Key>F3: string(0x1B) string("OR") \n\
    <Key>F4: string(0x1B) string("OS") \n\
    <Key>F5: string(0x1B) string("Ot") \n\
    <Key>F6: string(0x1B) string("Ou") \n\
    <Key>F7: string(0x1B) string("Ov") \n\
    <Key>F8: string(0x1B) string("Ol") \n\
    <Key>F9: string(0x1B) string("Ow") \n\
    <Key>F10: string(0x1B) string("Ox") \n\
    <Key>F11: string(0x1B) string("Oy") \n\
    <Key>F12: string(0x1B) string("Oz") \n\
    <Key>Insert: string(0x1B) string("Op") \n\
    <Key>R13: string(0x1B) string("[F") \n\
    <Key>Down: string(0x1B) string("OB") \n\
    <Key>R15: string(0x1B) string("[G") \n\
    <Key>Left: string(0x1B) string("OD") \n\
    <Key>R11: string(0x1B) string("Ou") \n\
    <Key>Right: string(0x1B) string("OC") \n\
    <Key>R7: string(0x1B) string("[H") \n\
    <Key>Up: string(0x1B) string("OA") \n\
    <Key>R9: string(0x1B) string("[I") \n\
    <Key>F28: string(0x7F) \n\
    <Key>SunXK_F37: string(0x1B) string("OC") \n\
    <Key>SunXK_F36: string(0x1B) string("OD")
    <Key>KP_Add: string(+)\n\
    <Key>KP_Divide: string(/)\n\
    <Key>KP_Enter: string(\015)\n\
    <Key>KP_Equal: string(=)\n\
    <Key>KP_Multiply: string(*)\n\
    <Key>KP_Subtract: string(-)\n\
    <Key>F16: start-extend() select-end(PRIMARY, CUT_BUFFER0, CLIPBOARD) \n\ <Key>F18: insert-selection(PRIMARY, CLIPBOARD) \n\
XTerm*tek4014.Translations: #override \
        @Num_Lock<Key>KP_0: string(0)\n\
        @Num_Lock<Key>KP_1: string(1)\n\
        @Num_Lock<Key>KP_2: string(2)\n\
        @Num_Lock<Key>KP_3: string(3)\n\
        @Num_Lock<Key>KP_4: string(4)\n\
        @Num_Lock<Key>KP_5: string(5)\n\
        @Num_Lock<Key>KP_6: string(6)\n\
        @Num_Lock<Key>KP_7: string(7)\n\
        @Num_Lock<Key>KP_8: string(8)\n\
        @Num_Lock<Key>KP_9: string(9)\n\
        @Num_Lock<Key>KP_Add: string(+)\n\
        @Num_Lock<Key>KP_Decimal: string(.)\n\
        @Num_Lock<Key>KP_Divide: string(/)\n\
        @Num_Lock<Key>KP_Enter: string(\015)\n\
        @Num_Lock<Key>KP_Equal: string(=)\n\
        @Num_Lock<Key>KP_Multiply: string(*)\n\
        @Num_Lock<Key>KP_Subtract: string(-)\n\
        <Key>KP_Add: string(+)\n\
        <Key>KP_Divide: string(/)\n\
        <Key>KP_Enter: string(\015)\n\
        <Key>KP_Equal: string(=)\n\
        <Key>KP_Multiply: string(*)\n\
        <Key>KP_Subtract: string(-)\n\

-- 
Jim Gottlieb
E-Mail: jimmy@denwa.info.com    In Japan: jimmy@denwa.linc.or.jp
V-Mail: +1 310 551 7702   Fax: 478-3060   Voice: 824-5454



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:08:54 CDT