[gtk+/gdk-backend-wayland] wayland: Adjust the hw keycode in key events for min_key_code
- From: Kristian Høgsberg <krh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gdk-backend-wayland] wayland: Adjust the hw keycode in key events for min_key_code
- Date: Thu, 10 Feb 2011 21:37:37 +0000 (UTC)
commit f0fe810999556bf840db57ff4ef4a352b1bac1bc
Author: Kristian Høgsberg <krh bitplanet net>
Date: Thu Feb 10 16:34:40 2011 -0500
wayland: Adjust the hw keycode in key events for min_key_code
gdk/wayland/gdkdevice-wayland.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 63adc6b..6727616 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -409,6 +409,9 @@ input_handle_key(void *data, struct wl_input_device *input_device,
struct xkb_desc *xkb;
GdkKeymap *keymap;
+ keymap = gdk_keymap_get_for_display (device->display);
+ xkb = _gdk_wayland_keymap_get_xkb_desc (keymap);
+
device->time = time;
event = gdk_event_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
event->key.window = g_object_ref (device->keyboard_focus);
@@ -416,12 +419,8 @@ input_handle_key(void *data, struct wl_input_device *input_device,
event->button.time = time;
event->key.state = device->modifiers;
event->key.group = 0;
- event->key.hardware_keycode = key;
-
- keymap = gdk_keymap_get_for_display (device->display);
- xkb = _gdk_wayland_keymap_get_xkb_desc (keymap);
-
code = key + xkb->min_key_code;
+ event->key.hardware_keycode = code;
level = 0;
if (device->modifiers & XKB_COMMON_SHIFT_MASK &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]