Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!shlump.nac.dec.com!netrix.nac.dec.com!lan_csse From: lan_csse@netrix.nac.dec.com (CSSE LAN Test Account) Newsgroups: comp.windows.x Subject: Re: How do I remap the keyboard? Message-ID: <22036@shlump.nac.dec.com> Date: 11 Apr 91 16:38:48 GMT References: <21867@shlump.nac.dec.com> <1991Apr9.172338.10501@medicus.com> Sender: news@shlump.nac.dec.com Organization: Digital Equipment Lines: 47 In article <1991Apr9.172338.10501@medicus.com> barry@medicus.com (Barrelda Q. Nammowitz) writes: > >I needed to do a similar thing for an application that we write here. >I redefine the function keys and arrow keys in my resource file, in >this case my .Xdefaults file. For my particular purpose the >key remapping is done for the xterm that my application runs in. > >*xterm*translations: #override F1: string("^AOP") \n\ > ... > Left: string("^A[D") > > >Hope this helps. Not yet; I've tried a couple of variants, such as: *xterm*translations: #override F13: string("You touched F13") \n\ F14: string("You touched F14") After adding this to .Xdefaults and saving it, I start up an xterm, in which I run my hd program (much like "od -xc" but vertical so it's more readable). The result when I type an F14 and a CR at it is: : hd 0:_[26~_ 0:153370 BB26EA This is the old "\e[26~" that was there before; nothing whatsoever has been changed. What I'd expect with the above definitions is: 0:You touc hed F13_ 0:56727676 66624330 9F504F53 8540613A What am I doing wrong? Is there something I need to do other than write a new .Xdefaults? Is it perhaps getting a cached version from the server instead of reading it from $HOME/.Xdefaults? Am I wasting my time? Also, it'd be nice if I didn't have to edit .Xdefaults to do this. After all, there are likely to be different applications running inside different windows; they may well need to different mappings. One of our applications wants to talk to a DOS system, and it should send the function-key codes that the IBM keyboard sends, else the DOS programs won't recognize them. Other applications are talking to other systems remotely, and they need to respond to the F* keys by sending whatever the remote system expects. In general,it seems that a mapping like this sort of needs to be per-window. The XLookupString() routine seems like it should somehow be involved, but TFM doesn't seem to say anything coherent on the subject...