Summary: Xterm keypad remapping not working in OW3

From: Rob Scott (zeke@chiton.ucsd.edu)
Date: Tue Aug 11 1992 - 13:39:41 CDT


Synopsis: Openwindows Release 3 doesn't honor a users xterm key remappings
(located in ~/.Xdefaults) under certain conditions.

Description: Under Openwindows Release 2, we developed a set of key remappings
for the "xterm" client that emulated most of the VT100 keypad keys for use
with the KED editor on an PDP-11 based (OS: RT-11) realtime data gathering
system. These remappings were placed in several users ~/.Xdefaults file.
These key remappings worked under OW2 and under X11 Release 5.

The particular need for these key remappings doesn't come up very often, so
it took several months after installing OW3 before one of the users brought
it to my attention that the key remappings no longer worked.

I looked in various manuals, Sun "Open Issues" reports, and did not find
any references to this sort of a bug in OW3. Finally, I probed the net
through the newsgroup comp.windows.open-look. I received 3 replies with
potential answers and significant encouragement. One of the suggestions
worked to solve the problem directly in the ~/.Xdefaults file, and I also
found 2 other workarounds (one of which I most humbly will take credit for).
Details to follow:
 
The original key remapping instructions from ~/.Xdefaults:
*.vt100.translations: #override \
        <Key>KP_Equal: string(0x1b) string("OP") \n\
        <Key>F24: string(0x1b) string("OP") \n\
    ...
        <Key>KP_Decimal: string(0x1b) string("On") \n\
        <Key>KP_Enter: string(0x1b) string("OM") \n

The easiest workaround:
        In OW2 and X11R5, the key translations set worked with the line:
                *.vt100.translations: #override \
        which specifies that this defined subset of vt100.translations
        overrides the defaults for any higher class widget definitions
        (in this case assumed to be vt100). This does not work in OW3.
        The OW3 fix is to be explicit about xterm in the widget class
        name, as in:
                xterm.vt100.translations: #override \
                        <Key>KP_Equal: string(0x1b) string("OP") \n\
                        <Key>F24: string(0x1b) string("OP") \n\
                    ...
                        <Key>KP_Decimal: string(0x1b) string("On") \n\
                        <Key>KP_Enter: string(0x1b) string("OM") \n
 
Another useful solution:
        I copied the "xterm" program to a new file called "kterm". I then
        used a PERL script to edit the file and change all internal references
        from "XTerm" to "KTerm" (these are the high-level widget class
        references coded into the program). I then created a copy of the
        application default definition file /usr/openwin/lib/app-defaults/XTerm,
        and called it KTerm (in the app-defaults directory). I appended the
        key remappings to the end of the definition file. This provides a
        permanent solution in the form of a new program that works identically
        to xterm, yet only remaps the keys for the KED editor for this program
        and not for all xterm sessions.
 
Yet another useful solution:
        Bruce Barnett, the author of "vttool" for Sunview has an X windows
        version called "xvttool", which has (if desired) on-screen mousable
        function key buttons and very flexible key remappings. Here is a
        brief section of the README file for the vttool and xvttool set.

                This package contains three different programs, that can be
                combined to provide a VT100 emulator for non-DEC terminals,
                SunView, or X window servers. Since the programs are separate,
                you can run any tty-based program inside of vttool or xvttool.
                In particular, any program with a lot of commands that are hard
                to remember can benefit from vttool or xvttool, as these
                programs add a panel with "buttons" you can click with a mouse -
                just like a programmable function key. Programs like tn3270,
                hack, rogue, omega as well as programs like rn, mail, csh, can
                benefit from labeled function keys.
 
                In addition, vttool and xvttool allow you to remap your
                keyboard for each window. You can specify sequences the
                function keys can send out, - even remapping the tab and
                delete key - if you wish.
 
                You can think of vttool/xvttool as a cmdtool with buttons and
                keyboard remapping.

        xvttool was formerly available on titan.rice.edu, which no longer
        appears to be in service. Bruce has informed me that he will probably
        be posting it to comp.sources.sun or comp.sources.x soon. He may be
        reached at "barnett@crd.ge.com".

My sincere thanks to the following persons for their suggestions and
encouragement:
        lee@sq.com (Liam Quin)
        lvirden@cas.org (Larry W. Virden)
        barnett@crd.ge.com (Bruce Barnett)

-- 
                    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     Rob Scott, System Administrator for the Marine Physical Laboratory
            Scripps Institution of Oceanography, UC San Diego
    Internet: zeke@mpl.ucsd.edu  Cserve: 76176,637  Voice: (619)534-8588



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:47 CDT