[gtk+/gdk-backend-wayland] Hook up xkb_keysym_to_string and xkb_string_to_keysym



commit 391b452d8330268d56b69498ff235fa25772c5e9
Author: Kristian Høgsberg <krh bitplanet net>
Date:   Fri Jan 7 14:21:56 2011 -0500

    Hook up xkb_keysym_to_string and xkb_string_to_keysym

 gdk/wayland/gdkdisplaymanager-wayland.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdkdisplaymanager-wayland.c b/gdk/wayland/gdkdisplaymanager-wayland.c
index 1b48014..25aa6fb 100644
--- a/gdk/wayland/gdkdisplaymanager-wayland.c
+++ b/gdk/wayland/gdkdisplaymanager-wayland.c
@@ -29,6 +29,8 @@
 
 #include "gdkinternals.h"
 
+#include <X11/extensions/XKBcommon.h>
+
 typedef struct _GdkWaylandDisplayManager GdkWaylandDisplayManager;
 typedef struct _GdkWaylandDisplayManagerClass GdkWaylandDisplayManagerClass;
 
@@ -108,14 +110,32 @@ static guint
 gdk_wayland_display_manager_lookup_keyval (GdkDisplayManager *manager,
 					   const gchar       *keyval_name)
 {
-  return /* XStringToKeysym (keyval_name); */ 0;
+  g_return_val_if_fail (keyval_name != NULL, 0);
+
+  return xkb_string_to_keysym(keyval_name);
 }
 
 static gchar *
 gdk_wayland_display_manager_get_keyval_name (GdkDisplayManager *manager,
 					     guint              keyval)
 {
-  return NULL;
+  static char buf[128];
+
+  switch (keyval)
+    {
+    case GDK_KEY_Page_Up:
+      return "Page_Up";
+    case GDK_KEY_Page_Down:
+      return "Page_Down";
+    case GDK_KEY_KP_Page_Up:
+      return "KP_Page_Up";
+    case GDK_KEY_KP_Page_Down:
+      return "KP_Page_Down";
+    }
+
+  xkb_keysym_to_string(keyval, buf, sizeof buf);
+
+  return buf;
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]