symbols: fix bug in modifier_map handling
authorRan Benita <ran234@gmail.com>
Thu, 12 Jul 2012 16:28:52 +0000 (19:28 +0300)
committerDaniel Stone <daniel@fooishbar.org>
Thu, 12 Jul 2012 17:08:00 +0000 (18:08 +0100)
commit9e5052259a0f5d3655cff1c6aa36cc303c866e47
treef11d8d259fd193aa82a421a12c55458e8102c7d9
parentfedcf3705bbcf51b86edff59d7c063815ff91605
symbols: fix bug in modifier_map handling

The code used to match a keysym to a keycode (see added comment)
differed in behavior from xkbcomp, always taking the first key it found.
This caused some incorrect interpretation of the xkeyboard-config data,
for example the one corrected in dump.data (see the diff): since the
de-neo layout sets the both_capslock option, the Left Shift key (LFSH)
has the Caps_Lock keysym in group 4 level 2; now since
    keycode(Left Shift) = 50 < keycode(Caps Lock) = 64
the Left Shift one was picked, instead of the Caps Lock one which is
group 1 level 1. The correct behavior is to pick according to group,
level, keycode.

Signed-off-by: Ran Benita <ran234@gmail.com>
src/xkbcomp/symbols.c
test/data/keymaps/dump.data