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.

I'm trying to remap Caps Lock to Control. Before I modify anything, xev reports the following for a press/release of Caps Lock:

KeyPress event, serial 73, synthetic NO, window 0x2600001,
    root 0x290, subw 0x0, time 50243576, (82,130), root:(1365,612),
    state 0x0, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

PropertyNotify event, serial 73, synthetic NO, window 0x2600001,
    atom 0x17c (XKLAVIER_STATE), time 50243577, state PropertyNewValue

PropertyNotify event, serial 73, synthetic NO, window 0x2600001,
    atom 0x17c (XKLAVIER_STATE), time 50243579, state PropertyNewValue

KeyRelease event, serial 73, synthetic NO, window 0x2600001,
    root 0x290, subw 0x0, time 50243680, (82,130), root:(1365,612),
    state 0x2, keycode 66 (keysym 0xffe5, Caps_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

I run the following to remap:

xmodmap -e 'remove Lock = Caps_Lock'
xmodmap -e 'keysym Caps_Lock = Control_L'
xmodmap -e 'add Lock = Caps_Lock'
xmodmap -e 'clear Lock'
xmodmap -e 'keycode 66 = Control_L'

Now, for a press/release on Caps Lock, xev reports:

KeyPress event, serial 80, synthetic NO, window 0x2600001,
    root 0x290, subw 0x0, time 50785441, (11,140), root:(1294,622),
    state 0x0, keycode 66 (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 80, synthetic NO, window 0x2600001,
    root 0x290, subw 0x0, time 50785521, (11,140), root:(1294,622),
    state 0x0, keycode 66 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

This seems fine, but the key still functions as Caps Lock in all other apps. I did notice that when I press the 'real' left control key there's no XKeysymToKeycode, but I've no idea what this signifies.

Here are the events for the real left Ctrl key press/release:

KeyPress event, serial 37, synthetic NO, window 0x2600001,
    root 0x290, subw 0x0, time 57111640, (176,176), root:(188,272),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2600001,
    root 0x290, subw 0x0, time 57111736, (176,176), root:(188,272),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
share|improve this question
1  
Since your question is about Linux Mint, it can't be migrated to Ask Ubuntu, sorry. –  slhck Jul 10 '13 at 11:17

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.