window: Use constant keycode offset of 8
authorDaniel Stone <daniel@fooishbar.org>
Thu, 16 Feb 2012 12:48:00 +0000 (12:48 +0000)
committerKristian Høgsberg <krh@bitplanet.net>
Fri, 17 Feb 2012 04:19:41 +0000 (23:19 -0500)
commit0d5a509ae50c4c47553c0ac8b2524843a461231b
tree3c42dc63d42c118e118d0d8b6b62ba679d0b641e
parent9d4f030c0b35327efcd2f31ea6af2dc889d2bf7e
window: Use constant keycode offset of 8

The X11 compositor currently posts its key presses as keycode - 8; this
is due to X11 having a historical minimum keycode of 8, whereas evdev is
numbered starting from 1.  So while the KEY_* constants begin with
KEY_ESC at 1, the corresponding keycode in both X11 and the XKB keymaps
is 9.

window, on the other hand, was relying on xkb->min_key_code being 8 to
translate its keycodes back to useful values in the XKB 'evdev' keycode
map.  min_key_code may not always be 8, for restricted subsets of the
keycode map.

Perhaps not the best solution, but at least consistent.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
clients/window.c