From 3029e05ac739cbfe026c997463dc4a57fd97a25e Mon Sep 17 00:00:00 2001 From: Quentin Glidic Date: Tue, 23 Feb 2016 10:44:36 +0100 Subject: keybindings: Rework modmask matching Signed-off-by: Quentin Glidic --- source/keyb.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'source/keyb.c') diff --git a/source/keyb.c b/source/keyb.c index 4ed04a67..4c246022 100644 --- a/source/keyb.c +++ b/source/keyb.c @@ -26,8 +26,7 @@ typedef struct _DefaultBinding char *keybinding; } DefaultBinding; -ActionBindingEntry abe[NUM_ABE]; -extern unsigned int CombinedMask; +ActionBindingEntry abe[NUM_ABE]; /** * LIST OF DEFAULT SETTINGS @@ -139,12 +138,8 @@ int abe_test_action ( KeyBindingAction action, unsigned int mask, xkb_keysym_t k for ( int iter = 0; iter < akb->num_bindings; iter++ ) { const KeyBinding * const kb = &( akb->kb[iter] ); - if ( kb->keysym == key ) { - // Bits 13 and 14 of the modifiers together are the group number, and - // should be ignored when looking up key bindings - if ( ( mask & ( CombinedMask ) ) == kb->modmask ) { - return TRUE; - } + if ( ( kb->keysym == key ) && ( kb->modmask == mask ) ) { + return TRUE; } } -- cgit v1.2.3