diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-01-07 22:58:43 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-01-07 22:58:43 +0200 |
commit | 1fb24b6296c69fa483ee6d698eb4dbdd5b098270 (patch) | |
tree | 31b5c70a467356220aed6230446673eff30b7466 | |
parent | 8974d59c0e5934efa7b2c9de7a9fb1c6a9be54fd (diff) | |
download | metacity-1fb24b6296c69fa483ee6d698eb4dbdd5b098270.tar.gz |
keybindings: add keycode_to_keysym
-rw-r--r-- | src/core/keybindings.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 6582bef4..733902ae 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -261,6 +261,20 @@ keysym_to_keycode (MetaDisplay *display, return XKeysymToKeycode (display->xdisplay, keysym); } +static KeySym +keycode_to_keysym (MetaDisplay *display, + guint keycode) +{ + if (keycode == meta_display_get_above_tab_keycode (display)) + return META_KEY_ABOVE_TAB; + +#ifdef HAVE_XKB + return XkbKeycodeToKeysym (display->xdisplay, keycode, 0, 0); +#else + return XKeycodeToKeysym (display->xdisplay, keycode, 0); +#endif +} + static void reload_keycodes (MetaDisplay *display) { @@ -1324,9 +1338,9 @@ meta_display_process_key_event (MetaDisplay *display, meta_ui_window_is_widget (screen->ui, event->xany.window)) return; - /* window may be NULL */ + keysym = keycode_to_keysym (display, event->xkey.keycode); + #ifdef HAVE_XKB - keysym = XkbKeycodeToKeysym (display->xdisplay, event->xkey.keycode, 0, 0); str = XKeysymToString (keysym); #else str = NULL; |