Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!ucdavis!csusac!unify!Unify.com!grp From: grp@Unify.com (Greg Pasquariello) Newsgroups: comp.windows.open-look Subject: Re: function keys f1,f11 and f12 Message-ID: <1990Nov8.083925@Unify.com> Date: 8 Nov 90 16:39:25 GMT References: Sender: news@Unify.Com (news admin) Reply-To: grp@Unify.com (Greg Pasquariello) Organization: Unify Corporation, Sacramento, CA, USA Lines: 80 In article , uunet!nmri!loach!alex (Alexander G. Macur) writes: > Has anyone been able to figure out how to get function keys > f1,f11 and f12 to work in an xterm under openlook verison 2.0 > on a sparcstation 1. > > On MIT X 11 R4 server they work fine > First you have to understand keys vs keysysms. Whenever a key is pressed, the X server takes that key, and maps it to a keysym. The keysym is what xterm thinks was really pressed. For example pressing the F3 Key causes the server to map an F3 keysym, and everything works just fine. The problem is that the xnews server maps the sun keys in an odd way. By default, it maps the L1 and L2 keys (on the left of the keyboard) to the F11 and F12 keysyms, and it maps the F1 key to the Help keysym. It then maps the F11 and F12 keys to the SunF36 and SunF37 keysysms. Don't ask me why, 'cuz I can't tell you. So, you've got three choices. The easiest is to use L1 and L2 instead of F11 and F12. You still have the problem with F1 though. The next easiest is to change your translations. Everywhere you use F11 or F12, change it to SunF36 or SunF37 respectively. This is not portable, and you still have the F1 problem. Lastly, you can use xmodmap to modify the key to keysym mapping. This is not hard, just a bit confusing. It will solve all of the problems that you describe. You can use "xmodmap -pk" to see the mappings of keycode to keysym. In order to remap the keyboard so that the keys send what you think the should, what you need to do is change the mapping of keycode to keysym. The keycodes for the various keys are: Key Label Key Code Default Keysym Name ---------- ---------- --------------------- F1 12 Help F11 16 SunF36 F12 18 SunF37 Help 125 Help L1 8 F11 L2 10 F12 The simplest command to remap all the keys you need is: xmodmap -e 'keycode 12 = F1' \ -e 'keycode 16 = F11' \ -e 'keycode 18 = F12' Now, F1 will send F1, F11 will send F11, and F12 will send F12. The Help key will still invoke help, and L1 and L2 will still send F11 and F12. If you want to remap them, you can do that too. If you want more information on this stuff, see the man pages for xmodmap, xev, and xnews. Xev allows you to watch all events on the window; when you press a key, you will be able to sey the keycode, and the keysym that is being generated. > > thanks in advance for any help > > > alex > > Alexander G. Macur > New Methods Research Inc, 6035 Corporate Dr. East Syracuse NY 13057 USA > Phone: 315-437-7500 E-mail: uunet!nmri!alex -- --- Greg Pasquariello Unify Corporation grp@Unify.Com