0

This question is similar to:

https://askubuntu.com/questions/33751/making-any-key-into-a-modifier-key

I have a machine with a non-standard keyboard layout (lenovo x1 carbon) where the CapsLock key has been replaced by Home, End. I'm used to mapping CapsLock as control, so I used xmodmap to map Home, End to Control:

xmodmap -e 'keycode 110 = Control_L' # Home
xmodmap -e 'keycode 115 = Control_L' # End

When I press Home (or End) alone, the correct keysym is detected:

state 0x0, keycode 110 (keysym 0xffe3, Control_L), same_screen YES,

But I am not able to use the remapped Home or End key as a modifier of any other key: when I press Control+a, the a key is not modified:

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157752, (829,406), root:(830,407),
    state 0x0, keycode 110 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157761, (829,406), root:(830,407),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XmbLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157912, (829,406), root:(830,407),
    state 0x0, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (61) "a"
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15157949, (829,406), root:(830,407),
    state 0x0, keycode 110 (keysym 0xffe3, Control_L), same_screen YES,
    XKeysymToKeycode returns keycode: 37
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Whereas if I use a "real" control key, the "a" key press has a control modifier state:

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15160488, (829,406), root:(830,407),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15161477, (829,406), root:(830,407),
    state 0x4, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (01) ""
    XmbLookupString gives 1 bytes: (01) ""
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15161588, (829,406), root:(830,407),
    state 0x4, keycode 38 (keysym 0x61, a), same_screen YES,
    XLookupString gives 1 bytes: (01) ""
    XFilterEvent returns: False

KeyRelease event, serial 36, synthetic NO, window 0x1000001,
    root 0xe0, subw 0x0, time 15161842, (829,406), root:(830,407),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Is it possible to configure the Home key in my case as a Control modifier key? Or is there some hardware limitation that prevents this?

0

Besides your two commands, you must add Control :
xmodmap -e 'keycode 110 = Control_L' # Home
xmodmap -e 'keycode 115 = Control_L' # End
xmodmap -e 'add Control = Control_L'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.