keymap: consider modifier state when picking a mapping

Pass the modifier state to the keymap lookup function.  In case multiple
keysym -> keycode mappings exist look at the modifier state and prefer
the mapping where the modifier state matches.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20180222070513.8740-6-kraxel@redhat.com
This commit is contained in:
Gerd Hoffmann 2018-02-22 08:05:13 +01:00
parent 23ad24e48c
commit abb4f2c965
5 changed files with 48 additions and 6 deletions

View file

@ -271,7 +271,8 @@ static void curses_refresh(DisplayChangeListener *dcl)
keysym = chr;
}
keycode = keysym2scancode(kbd_layout, keysym & KEYSYM_MASK);
keycode = keysym2scancode(kbd_layout, keysym & KEYSYM_MASK,
false, false, false);
if (keycode == 0)
continue;