From cbdf1ac8b60cfd8843ee2f93cffceb82b5a8ed1e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 28 Aug 2015 09:09:31 +0200 Subject: [PATCH] =?utf8?q?bindings:=20invert=20shift=20bit,=20don=E2=80=99?= =?utf8?q?t=20just=20remove=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Before this commit, we only made the transformation of C → c, with this commit we’re considering both c → C and C → c. fixes #1870 --- src/bindings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindings.c b/src/bindings.c index 390ece7e..520f5522 100644 --- a/src/bindings.c +++ b/src/bindings.c @@ -288,7 +288,7 @@ static void add_keycode_if_matches(struct xkb_keymap *keymap, xkb_keycode_t key, const xkb_layout_index_t layout = xkb_state_key_get_layout(resolving->xkb_state, key); if (layout == XKB_LAYOUT_INVALID) return; - if (xkb_state_key_get_level(resolving->xkb_state, key, layout) != 1) + if (xkb_state_key_get_level(resolving->xkb_state, key, layout) > 1) return; sym = xkb_state_key_get_one_sym(resolving->xkb_state_no_shift, key); if (sym != resolving->keysym) @@ -367,7 +367,7 @@ void translate_keysyms(void) { (void)xkb_state_update_mask( dummy_state_no_shift, - (bind->event_state_mask & 0x1FFF) & ~XCB_KEY_BUT_MASK_SHIFT /* xkb_mod_mask_t base_mods, */, + (bind->event_state_mask & 0x1FFF) ^ XCB_KEY_BUT_MASK_SHIFT /* xkb_mod_mask_t base_mods, */, 0 /* xkb_mod_mask_t latched_mods, */, 0 /* xkb_mod_mask_t locked_mods, */, 0 /* xkb_layout_index_t base_group, */, -- 2.39.5