From cdbbe39011a5d0f94250c7bbd01ed12f14bea894 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 4 Jan 2009 17:38:40 +0100 Subject: [PATCH] key: add fallback when second column unavailable This allows to translate certain combinaison like Shift+Insert. Insert exists, but Shift+Insert converts to no symbol, resulting in XCB_NONE returned. We return either the k0 alternative, without shift, so we got at least the 'simple' keysym. Signed-off-by: Julien Danjou --- key.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/key.c b/key.c index 3055d8da..677e3161 100644 --- a/key.c +++ b/key.c @@ -205,6 +205,10 @@ key_getkeysym(xcb_keycode_t detail, uint16_t state) k1 = xcb_key_symbols_get_keysym(globalconf.keysyms, detail, 1); } + /* If the second column does not exists use the first one. */ + if(k1 == XCB_NONE) + k1 = k0; + /* The numlock modifier is on and the second KeySym is a keypad * KeySym */ if((state & globalconf.numlockmask) && xcb_is_keypad_key(k1))