diff options
author | Michael Cardell Widerkrantz <mc@hack.org> | 2011-03-20 19:38:32 +0100 |
---|---|---|
committer | Michael Cardell Widerkrantz <mc@hack.org> | 2011-03-20 19:38:32 +0100 |
commit | ef69d425dde794547b2403ab5069711bcaa366c0 (patch) | |
tree | 78c53188a194111c32eeb1b720db8ce61f5cb130 /mcwm.c | |
parent | f3120f3f5ad8acaf1dde2728882b4f3b6c9e0a7a (diff) | |
download | mcwm-ef69d425dde794547b2403ab5069711bcaa366c0.zip |
Check explicitly for key and modifier mappings when remapping the
keyboard. We don't want to do anything when mouse buttons have been
remapped.
Diffstat (limited to 'mcwm.c')
-rw-r--r-- | mcwm.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -3048,18 +3048,33 @@ void events(void) break; case XCB_MAPPING_NOTIFY: + { + xcb_mapping_notify_event_t *e + = (xcb_mapping_notify_event_t *)ev; + /* * XXX Gah! We get a new notify message for *every* key! * We want to know when the entire keyboard is finished. + * Impossible? Better handling somehow? */ + /* + * We're only interested in keys and modifiers, not + * pointer mappings, for instance. + */ + if (e->request != XCB_MAPPING_MODIFIER + && e->request != XCB_MAPPING_KEYBOARD) + { + break; + } + /* Forget old key bindings. */ xcb_ungrab_key(conn, XCB_GRAB_ANY, screen->root, XCB_MOD_MASK_ANY); /* Use the new ones. */ setupkeys(); - - break; + } + break; case XCB_UNMAP_NOTIFY: { |