1

I edited ~/.Xmodmap to set keycode 118 to Control_L, so that I have the same functionality for CTRL on both sides of Space. I had to remove and add Control_L to control and it works fine now.

keycode 127 = Insert


remove control = Control_L

keycode 118 = Control_L

add control = Control_L


keycode 135 = ISO_Level3_Shift

keycode 108 = space


remove mod1 = Alt_L

keycode 94 = Alt_L ISO_Next_Group Alt_L ISO_Next_Group

add mod1 = Alt_L

Now Alt+Tab doesn't work, even though both Alts work the same way otherwise. Alt+Tab with the new Alt switches to 1 other program and then back to the first one. It doesn't show the task switcher menu at all.

Output of xmodmap -pm:

[hax@localhost ~]$ xmodmap -pm

xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):



shift       Shift_L (0x32),  Shift_R (0x3e)

lock        Caps_Lock (0x42)

control     Control_L (0x25),  Control_R (0x69),  Control_L (0x76)

mod1        Alt_L (0x40),  Alt_L (0x5e),  Alt_L (0xcc),  Meta_L (0xcd)

mod2        Num_Lock (0x4d)

mod3      

mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)

mod5        ISO_Level3_Shift (0x5c),  space (0x6c),  ISO_Level3_Shift (0x87),  Mode_switch (0xcb)

Output of xbindkeys -k for the old Alt:

[hax@localhost ~]$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"NoCommand"
    m:0x8 + c:64
    Alt + Alt_L

Output of xbindkeys -k for the new Alt:

[hax@localhost ~]$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after "NoCommand"
in $HOME/.xbindkeysrc to bind a key.
"NoCommand"
    m:0x8 + c:94
    Alt + Alt_L

Output of xev for the old Alt:

KeyPress event, serial 37, synthetic NO, window 0x3e00001,
    root 0x9b, subw 0x0, time 10657877, (328,658), root:(1612,798),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x3e00001,
    root 0x9b, subw 0x0, time 10657981, (328,658), root:(1612,798),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Output of xev for the new Alt:

KeyPress event, serial 40, synthetic NO, window 0x3e00001,
    root 0x9b, subw 0x0, time 10659997, (328,658), root:(1612,798),
    state 0x0, keycode 94 (keysym 0xffe9, Alt_L), same_screen YES,
    XKeysymToKeycode returns keycode: 64
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x3e00001,
    root 0x9b, subw 0x0, time 10660077, (328,658), root:(1612,798),
    state 0x8, keycode 94 (keysym 0xffe9, Alt_L), same_screen YES,
    XKeysymToKeycode returns keycode: 64
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
  • xmodmap can only associate a keycode with a given modifier (likewise associated with one or more keycodes), and the existing modifiers don't distinguish between left and right keys. – Thomas Dickey Jul 30 '16 at 14:47
  • @ThomasDickey The answer for the controls was to remove and add the Control_L. The same, however, doesn't work for Alt_L.... – iJustWantVolume Jul 30 '16 at 18:12
  • You need to look at the output of xmodmap -pm as well, to see which keycodes cause control or alt/meta (mod1) or iso-next-group and so on. When you move a shift/control/meta function you also need to update this map which maps keysyms to keycodes once only. – meuh Jul 30 '16 at 18:18
  • @meuh I added the output of xmodmap -pm. After I removed and added Alt_L to mod1, it added two Alt_L entries to mod1. I really don't understand why the codes are different in xmodmap -pm and in xev and xbindkeys -k. I'm seriously losing it here... – iJustWantVolume Jul 30 '16 at 18:43
  • the codes should be the same, but in hex in some places and decimal in others which makes it hard to follow I agree. – meuh Jul 30 '16 at 19:05

Your Answer

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

Browse other questions tagged or ask your own question.