keygrabber: ignore modifiers for name of control keys

`xkb_state_key_get_one_sym` returns `Meta_L` for a (release) event of
`Alt_L` when Shift is pressed.

This patch changes it to use `xcb_key_symbols_get_keysym` in the same
way like normal key handling does it in `event_handle_key`.  This was
changed in 372d12e, but apparently forgotten for the keygrabber.

Closes https://github.com/awesomeWM/awesome/pull/364.
This commit is contained in:
Daniel Hahler 2015-07-28 15:07:23 +02:00
parent 2b224dd954
commit 5ad3f03283
1 changed files with 4 additions and 7 deletions

View File

@ -89,14 +89,13 @@ keygrabber_handlekpress(lua_State *L, xcb_key_press_event_t *e)
if (is_control(buf)) if (is_control(buf))
{ {
/* use text names for control characters */ /* Use text names for control characters, ignoring all modifiers. */
xkb_keysym_t keysym = xkb_state_key_get_one_sym(globalconf.xkb_state, e->detail); xcb_keysym_t keysym = xcb_key_symbols_get_keysym(globalconf.keysyms,
e->detail, 0);
xkb_keysym_get_name(keysym, buf, countof(buf)); xkb_keysym_get_name(keysym, buf, countof(buf));
} }
luaA_pushmodifiers(L, e->state); luaA_pushmodifiers(L, e->state);
lua_pushstring(L, buf); lua_pushstring(L, buf);
switch(e->response_type) switch(e->response_type)
@ -108,8 +107,6 @@ keygrabber_handlekpress(lua_State *L, xcb_key_press_event_t *e)
lua_pushliteral(L, "release"); lua_pushliteral(L, "release");
break; break;
} }
return true; return true;
} }