[metacity] keybindings: add keycode_to_keysym
- From: Alberts MuktupÄvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [metacity] keybindings: add keycode_to_keysym
- Date: Wed, 7 Jan 2015 21:16:40 +0000 (UTC)
commit 1fb24b6296c69fa483ee6d698eb4dbdd5b098270
Author: Alberts MuktupÄvels <alberts muktupavels gmail com>
Date: Wed Jan 7 22:58:43 2015 +0200
keybindings: add keycode_to_keysym
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 6582bef..733902a 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]