Keycode for MultiKey?

How would I add the MultiKey to my keyboard layout? xev event:

KeyPress event, serial 40, synthetic NO, window 0x5200001,
root 0x128, subw 0x0, time 55852842, (780,-623), root:(780,243),
state 0x0, keycode 9 (keysym 0xff20, Multi_key), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: True

As far as I remember, the default for Multi_key on X11 is Shift+AltGr, which you should be able to add to the keymap as LSHIFT(Key_RightAlt). If that does not work (and there’s a chance it won’t, because AltGr+Shift is typically another binding, so order matters, which means you need to send these separately.), you can try a macro like this:

const macro_t macroMultiKey(uint8_t keyState) {
  return MACRODOWN(I(50), D(LeftShift), D(RightAlt), U(RightAlt), U(LeftShift));

As a third option, you can configure your environment to use another key, or key combination as the Compose/MultiKey. (I use RightAlt alone.)


We should really add a page (or three) to the Kaleidoscope wiki with instructions for determining what the correct Key value to put in the keymap that corresponds to an existing key on another keyboard. In other words, how to translate the output of xev on Linux, Karabiner Event Viewer on macOS, and…whatever can do this on Windows.

1 Like