+ }
+
+ if (k->xkb_compose && ev->value == KBDKEY_DOWN) {
+ if (num == 1 && !data->resync) {
+ xkb_compose_state_feed(k->xkb_compose, keysyms[0]);
+ cstatus = xkb_compose_state_get_status(k->xkb_compose);
+ } else {
+ cstatus = XKB_COMPOSE_CANCELLED;
+ }
+
+ switch (cstatus) {
+ case XKB_COMPOSE_NOTHING:
+ /* keep produced keysyms and forward unchanged */
+ break;
+ case XKB_COMPOSE_COMPOSING:
+ /* consumed by compose-state, drop keysym */
+ keysyms = NULL;
+ num = 0;
+ break;
+ case XKB_COMPOSE_COMPOSED:
+ /* compose-state produced sth, replace keysym */
+ num = keyboard_read_compose(k, &keysyms);
+ xkb_compose_state_reset(k->xkb_compose);
+ break;
+ case XKB_COMPOSE_CANCELLED:
+ /* canceled compose, reset, forward cancellation sym */
+ xkb_compose_state_reset(k->xkb_compose);
+ break;
+ }
+ } else if (k->xkb_compose &&
+ num == 1 &&
+ keysyms[0] == XKB_KEY_Multi_key &&
+ !data->resync &&
+ ev->value == KBDKEY_UP) {
+ /* Reset compose state on Multi-Key UP events. This effectively
+ * requires you to hold the key during the whole sequence. I
+ * think it's pretty handy to avoid accidental
+ * Compose-sequences, but this may break Compose for disabled
+ * people. We really need to make this opional! (TODO) */
+ xkb_compose_state_reset(k->xkb_compose);
+ }
+
+ if (ev->value == KBDKEY_UP) {
+ /* never produce keysyms for UP */
+ keysyms = NULL;
+ num = 0;
+ }