Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

First post. Here it goes:

I have Ubuntu 10.10, maverick.

A few days ago I was trying to convert my 'command' key on my apple computer to a 'ctrl' key, and after searching online I ran into xmodmap. Let me first go ahead and say that I've figured out in the end how to remap my key (go to System->preferences->keyboard, then layouts, then win/alt key and map it to control). But before this, I had been trying to use xmodmap to do the remapping. In the process, I realized that xmodmap just plain doesn't work for me, and there's nothing I can find online reporting a similar problem.

Even before creating any kind of .Xmodmap file to be executed everytime on login, the command just doesn't seem to work in the terminal. If I run xev, the output of my left command key is:

KeyPress event, serial 33, synthetic NO, window 0x4600001,
root 0xc9, subw 0x0, time 2747931, (120,-383), root:(123,436),
state 0x0, keycode 133 (keysym 0x85, (no name)), same_screen YES,
XLookupString gives 2 bytes: (c2 85) ""
XmbLookupString gives 2 bytes: (c2 85) ""
XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x4600001,
root 0xc9, subw 0x0, time 2748059, (120,-383), root:(123,436),
state 0x4, keycode 133 (keysym 0x85, (no name)), same_screen YES,
XLookupString gives 0 bytes: 
XFilterEvent returns: False

Which means that my command character's keycode is 133. Doing the same for my ctrl key tells me that the keycode for my left control key is 37.

But doing this command:

xmodmap -e "keycode 133 = Control_L"

would not make my command key function like a control character. Furthermore I know that xmodmap did the mapping, because typing in the command character into xev now gives:

KeyPress event, serial 33, synthetic NO, window 0x4600001,
root 0xc9, subw 0x0, time 3016638, (293,-389), root:(296,430),
state 0x0, keycode 133 (keysym 0xffe3, Control_L), same_screen YES,
XKeysymToKeycode returns keycode: 37
XLookupString gives 0 bytes: 
XmbLookupString gives 0 bytes: 
XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x4600001,
root 0xc9, subw 0x0, time 3016750, (293,-389), root:(296,430),
state 0x4, keycode 133 (keysym 0xffe3, Control_L), same_screen YES,
XKeysymToKeycode returns keycode: 37
XLookupString gives 0 bytes: 
XFilterEvent returns: False

And the keycode 133 entry from xmodmap -pke output also looks correct:

keycode 133 = Control_L NoSymbol Control_L

At this point, the command key would still just act like a command key. My question is, is something overriding xmodmap's key mappings, and if so, where and how?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.