From a65fcd0859898c86f0a980c38c9f4c079c6d8415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Fri, 7 Jan 2011 14:21:56 -0500 Subject: [PATCH] Hook up xkb_keysym_to_string and xkb_string_to_keysym --- gdk/wayland/gdkdisplaymanager-wayland.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/gdk/wayland/gdkdisplaymanager-wayland.c b/gdk/wayland/gdkdisplaymanager-wayland.c index 1b48014cdf..25aa6fb989 100644 --- a/gdk/wayland/gdkdisplaymanager-wayland.c +++ b/gdk/wayland/gdkdisplaymanager-wayland.c @@ -29,6 +29,8 @@ #include "gdkinternals.h" +#include + 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