diff --git a/src/keymap-dump.c b/src/keymap-dump.c index fae1aa5..4ae5395 100644 --- a/src/keymap-dump.c +++ b/src/keymap-dump.c @@ -239,7 +239,7 @@ write_keycodes(struct xkb_keymap *keymap, struct buf *buf) continue; write_buf(buf, "\t\t%6s = %d;\n", - KeyNameText(key->name), XkbKeyGetKeycode(keymap, key)); + KeyNameText(key->name), key->keycode); } for (i = 0; i < XKB_NUM_INDICATORS; i++) { diff --git a/src/keymap.h b/src/keymap.h index a3452b0..be22124 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -382,13 +382,6 @@ XkbKey(struct xkb_keymap *keymap, xkb_keycode_t kc) return &darray_item(keymap->keys, kc); } -static inline xkb_keycode_t -XkbKeyGetKeycode(struct xkb_keymap *keymap, const struct xkb_key *key) -{ - /* Hack to avoid having to keep the keycode inside the xkb_key. */ - return (xkb_keycode_t)(key - keymap->keys.item); -} - #define xkb_foreach_key(iter, keymap) \ darray_foreach(iter, keymap->keys)