aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-02-11 03:56:42 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2016-02-11 03:56:42 +0100
commit16c811046903ad9eeb345284d13482229f11b00f (patch)
treebf8905174209bd325ddd48d9e0f7394c9b7eef38
parent945f620a3ce6a3d990182cd232664138b648cae2 (diff)
downloaddesktop-tools-16c811046903ad9eeb345284d13482229f11b00f.tar.gz
desktop-tools-16c811046903ad9eeb345284d13482229f11b00f.tar.xz
desktop-tools-16c811046903ad9eeb345284d13482229f11b00f.zip
dwmstatus: use XkbLookupKeysym
-rw-r--r--dwmstatus.c9
1 files 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);