Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!btr!mips!smsc.sony.com!dce From: dce@smsc.sony.com (David Elliott) Newsgroups: comp.windows.x Subject: Re: Mapping keys. Message-ID: <1991Mar28.070153.13152@smsc.sony.com> Date: 28 Mar 91 07:01:53 GMT References: <9103270712.AA09645@lightning.McRCIM.McGill.EDU> Organization: Sony Microsystems Corp, San Jose, CA Lines: 26 In article <9103270712.AA09645@lightning.McRCIM.McGill.EDU> mouse@lightning.mcrcim.mcgill.EDU (der Mouse) writes: >Many clients (those based on Xt, typically) have a Translations >resource you can set which controls this; you could do something like > > fooclient*Translations: \ > KP_0: string(0x1b) string("KP0") > >which would (if I have the syntax right - I never use this mechanism) >cause the keypad 0 key to turn into the string ESC K P 0 (ESC is 0x1b). Note that the "string" part is xterm-specific, and each client will be different. In fact, I don't know of any other client that uses "string", though the Athena Text widgets have an insert-string. The "string" is called an "action", and must be registered by the client. Mostly, the widgets register their actions (most Text widgets have a lot of actions for editing). Enterprising programmers will also add actions of their own for higher-level functions, especially in cases where menus can be unweildy. Some widget sets, notably OSF/Motif, force certain restrictions on translations. For example, the F4 and F10 keys on my system can not be remapped within a Motif-based application without modifying the user's Motif bindings file. Thus, the recently-created xterm with Motif scrollbars and menus (found on export) doesn't work for me like the MIT xterm.