aboutsummaryrefslogtreecommitdiff
path: root/ui/keymaps.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-01-22 10:28:13 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-02-05 10:45:44 +0100
commit4ed26e19d90bf5a4ea5662118ae5a2af46e61d36 (patch)
tree9c158c2ce5452370cd575f1d38f52ae9bbb7761a /ui/keymaps.c
parentc2f2ba4983aa1dd634e78347706e6585afc1f2a0 (diff)
keymap: pass full keyboard state to keysym2scancode
Pass the keyboard state tracker handle down to keysym2scancode(), so the code can fully inspect the keyboard state as needed. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-id: 20190122092814.14919-8-kraxel@redhat.com
Diffstat (limited to 'ui/keymaps.c')
-rw-r--r--ui/keymaps.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/keymaps.c b/ui/keymaps.c
index 6e44f738ed..c8b2135340 100644
--- a/ui/keymaps.c
+++ b/ui/keymaps.c
@@ -188,7 +188,7 @@ kbd_layout_t *init_keyboard_layout(const name2keysym_t *table,
int keysym2scancode(kbd_layout_t *k, int keysym,
- bool shift, bool altgr, bool ctrl)
+ QKbdState *kbd)
{
static const uint32_t mask =
SCANCODE_SHIFT | SCANCODE_ALTGR | SCANCODE_CTRL;
@@ -220,13 +220,13 @@ int keysym2scancode(kbd_layout_t *k, int keysym,
* If so, prefer that one.
*/
mods = 0;
- if (shift) {
+ if (kbd && qkbd_state_modifier_get(kbd, QKBD_MOD_SHIFT)) {
mods |= SCANCODE_SHIFT;
}
- if (altgr) {
+ if (kbd && qkbd_state_modifier_get(kbd, QKBD_MOD_ALTGR)) {
mods |= SCANCODE_ALTGR;
}
- if (ctrl) {
+ if (kbd && qkbd_state_modifier_get(kbd, QKBD_MOD_CTRL)) {
mods |= SCANCODE_CTRL;
}