Why does the setxkbmap compose key mess with other keys

keyboardxkbxorg

I just found a tip to set the compose key manually:

setxkbmap -option compose:caps

Unfortunately, after running this several keypresses act as if the compose key had been pressed. For example, to get a tilde, I now have to press Shift~ twice, and I can no longer figure out how to get a single or double quote – When I press that key twice (without pressing Caps Lock) I get a single ´ (without Shift) or ¨ (with Shift) character.

$ setxkbmap -print 
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us(dvorak-intl)+inet(evdev)+level3(ralt_switch)+compose(caps)"  };
    xkb_geometry  { include "pc(pc105)" };
};

Setting the compose key to the more popular Right-Alt did not help – The results are the same with the following settings:

$ setxkbmap -print 
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us(dvorak-intl)+inet(evdev)+level3(ralt_switch)+compose(ralt)"  };
    xkb_geometry  { include "pc(pc105)" };
};

Stranger still, even after disabling the compose key with setxkbmap -option the keys are still messed up.

On a different machine with GNOME 3 and similar settings it works just fine (Caps Lock, a, a produces å, while a single press of Shift~ produces ~):

$ setxkbmap -print 
xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)" };
    xkb_types     { include "complete"  };
    xkb_compat    { include "complete"  };
    xkb_symbols   { include "pc+us(dvorak-alt-intl)+ch:2+inet(evdev)+compose(caps)" };
    xkb_geometry  { include "pc(pc105)" };
};

Maybe it's an LXDE issue – I'll test it next week.

Best Answer

Turns out the problem was actually the keyboard layout - Switching to English (Dvorak alternative international no dead keys) (XKBVARIANT="dvorak-alt-intl" in /etc/default/keyboard) fixed it.

Unfortunately I can't find a way to set this for my user only.

Related Question