From 16c811046903ad9eeb345284d13482229f11b00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Thu, 11 Feb 2016 03:56:42 +0100 Subject: [PATCH] dwmstatus: use XkbLookupKeysym --- dwmstatus.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dwmstatus.c b/dwmstatus.c index 6d66e5e..fbfcf00 100644 --- a/dwmstatus.c +++ b/dwmstatus.c @@ -2713,10 +2713,13 @@ static void on_x_keypress (struct app_context *ctx, XEvent *e) { XKeyEvent *ev = &e->xkey; - KeySym keysym = XkbKeycodeToKeysym (ctx->dpy, (KeyCode) ev->keycode, - 0 /* XXX: current group? */, !!(ev->state & ShiftMask)); + unsigned unconsumed_mods; + KeySym keysym; + if (!XkbLookupKeySym (ctx->dpy, + (KeyCode) ev->keycode, ev->state, &unconsumed_mods, &keysym)) + return; for (size_t i = 0; i < N_ELEMENTS (g_keys); i++) - if (keysym == g_keys[i].keysym + if (g_keys[i].keysym == keysym && g_keys[i].mod == ev->state && g_keys[i].handler) g_keys[i].handler (ctx, g_keys[i].arg);