[gtk+] wayland: Get min/max keycode from xkb keymap
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Get min/max keycode from xkb keymap
- Date: Sat, 26 Mar 2016 22:49:15 +0000 (UTC)
commit 59d8cba48229f03ab7657ae3258174f1cd6d41fd
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 26 18:48:27 2016 -0400
wayland: Get min/max keycode from xkb keymap
Instead of hardcoding 8/255 here.
gdk/wayland/gdkkeys-wayland.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index 4819ab6..46d2631 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -133,10 +133,13 @@ gdk_wayland_keymap_get_entries_for_keyval (GdkKeymap *keymap,
struct xkb_keymap *xkb_keymap = GDK_WAYLAND_KEYMAP (keymap)->xkb_keymap;
GArray *retval;
guint keycode;
+ xkb_keycode_t min_keycode, max_keycode;
retval = g_array_new (FALSE, FALSE, sizeof (GdkKeymapKey));
- for (keycode = 8; keycode < 255; keycode++) /* FIXME: min/max keycode */
+ min_keycode = xkb_keymap_min_keycode (xkb_keymap);
+ max_keycode = xkb_keymap_max_keycode (xkb_keymap);
+ for (keycode = min_keycode; keycode < max_keycode; keycode++)
{
gint num_layouts, layout;
num_layouts = xkb_keymap_num_layouts_for_key (xkb_keymap, keycode);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]