Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!swrinde!mips!pacbell.com!pacbell!rtech!medicus!barry From: barry@medicus.com (Barrelda Q. Nammowitz) Newsgroups: comp.windows.x Subject: Re: How do I remap the keyboard? Message-ID: <1991Apr9.172338.10501@medicus.com> Date: 9 Apr 91 17:23:38 GMT References: <21867@shlump.nac.dec.com> Organization: Medicus Systems Corp., Clinical Data Division, Alameda, CA Lines: 52 In article <21867@shlump.nac.dec.com> lan_csse@netrix.nac.dec.com (CSSE LAN Test Account) writes: >[.....].. >Another example is redefining a function key. Again, it is obvious that >the intention was that I be able to do it; it is equally obvious that I'm >not sufficiently intelligent to decrypt the descriptions in the manuals. >An example here is that the key labeled "F5" sends the keycode 90, which >is mapped onto keysym 0xffc2=F5. When I run a program and type an F5 at >it, what it receives is the character string: > 1B 5B 31 35 7E >which is "\e[15~" in another notation. Suppose I wanted the F5 key to give >the sequence "\e5F", or: > 1B 35 46 >in hex. How would I go about telling X that this is what I want? Or is this >translation even done by X? I mean, xev tells me that the keysym F5 has an >XLookupString that is 0 characters long, so maybe X isn't even doing it, but >in that case, who might it be, and how do I make a deal with them? > >It sure seems that there oughta be some examples lying about, but I have >had no success in finding them... 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\ F2: string("^AOQ") \n\ F3: string("^AOR") \n\ F4: string("^AOS") \n\ F5: string("^AOT") \n\ F6: string("^AOU") \n\ F7: string("^AOV") \n\ F8: string("^AOW") \n\ F9: string("^AOX") \n\ F10: string("^AOY") \n\ F11: string("^B") \n\ F12: string("^E") \n\ Up: string("^A[A") \n\ Down: string("^A[B") \n\ Right: string("^A[C") \n\ Left: string("^A[D") Hope this helps. --barry ------------------------------------------------------------------------------ Barry Namm Medicus Systems Corporation barry@medicus.com Clinical Data Systems {uunet,sun!rtech,unisoft}!medicus!barry Alameda, California