# Keycode for MultiKey?

**URL:** <https://community.keyboard.io/t/keycode-for-multikey/1138>\
**Category:** Programming\
**Tags:** question\
**Created:** [February 27, 2018, 1:54pm UTC](https://community.keyboard.io/t/keycode-for-multikey/1138 "2018-02-27T13:54:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![reactormonk](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/reactormonk/32/967_2.png) [@reactormonk](https://community.keyboard.io/u/reactormonk)\
**Post date:** [February 27, 2018, 1:54pm UTC](https://community.keyboard.io/t/keycode-for-multikey/1138/1 "2018-02-27T13:54:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [February 27, 2018, 5:07pm UTC](https://community.keyboard.io/t/keycode-for-multikey/1138/2 "2018-02-27T17:07:09Z")

</div>

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:

```auto
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.)

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [February 27, 2018, 5:21pm UTC](https://community.keyboard.io/t/keycode-for-multikey/1138/3 "2018-02-27T17:21:42Z")

</div>

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.
