On 5/13/2011 12:48 AM, Gustav Degreef wrote:
Hi folks,
I need help in mapping the escape key to a new key or key combination on my wife's laptop. The escape key stopped working completely, but the rest of the keyboard is fine.
Using opensuse 11.2 - 64bit, KDE 4.3.5
I went to Desktop Settings, ---> system settings -> input actions I added a new action and selected the new input key combination. But that's as far as I get, I can't figure out how to designate the ESC key in the "action" tab. I googled, but can not find out how to designate the ESC key. Pointers would be appreciated. Gustav.
Ctrl+[ is already another way to type it. Also Ctrl+3 In a case like that where it's a hardware problem, I would fix the console keymap as well as X. Also, setting the key at the console level MAY automatically fix X (gui, kde) as well, after rebooting. For the console do this: Look at "man showkey" and "man loadkeys" hit Ctrl-Alt-F1 to switch from the gui to console #1 login as root or login as anyone and then su or sudo bash run showkey and then press the key you want to use for Esc, preferably one of the odd keys that laptops have that isn't useful for anything else. Make note of the number it showed. Wait a few seconds for showkey to exit or press ctrl+d. On a server rack kvm tray I just tried, there are two Windows keys and a Menu key that I don't use. The left-Win key produced: keycode 29 release (this is the Enter key) keycode 125 press keycode 125 release So the left-windows key is keycode 125, at least in terms of the linux console and speaking in decimal numbers. To make that key be recognized as the escape key: echo "keycode 125 = Escape" |loadkeys This doesn't break the regular escape key or anything else. keycode 1 is still also mapped to Escape, and keycode 125 had no mapping to start with so changing it to escape didn't take away anything else. See "dumpkeys |less" to see what all keycodes are currently mapped to. Now, until I reboot or unless I manually run other loadkeys commands, the left-windows key is a 2nd Esc key on that machine. There are a few different ways to make this happen every boot. Probably the simplest / safest way is to add the loadkeys command to /etc/init.d/boot.local Just edit that file and add this line to the bottom: echo "keycode 125 = Escape" |loadkeys Then reboot. This should definitely fix the console. To fix X (which fixes everything in X including kde and all apps) you want to look up "xev" to see what keycode your key generates in X, (it won't be the same keycode number as what showkey showed at the console) Then use xmodmap like xmodmap -e "keycode 115 = Escape" Which should temporarily make the key work until reboot. Since every distro is different about how and where it places config files and start scripts and user modifiable optional extra config files etc, and since I don't have any _recent_ versions of opensuse with X installed handy (I have recent ubuntu and old opensuse, but neither of those will help) I can't say where is the best place to put the xmodmap command in order to get it run automatically every X startup. Traditionally you'd create ~/.xinitrc and add it to the end of that. That may or may not work as expected on current opensuse. (it might work fine, or it might prevent kde or anything else from starting up, or it might be harmlessly ignored.) If it does work, note that it will only affect that user. If multiple people have login accounts, they each need to do that in their own home directory. Probably there is a nicer gui way to set this in yast somewhere, but just in case no one pipes up and supplies that... -- bkw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org