[vlc-commits] xkb: simplify keycode offset

Rémi Denis-Courmont git at videolan.org
Tue May 29 20:57:57 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue May 29 21:56:37 2018 +0300| [a9009c3c499ec0b96230053e80e34051c72afacb] | committer: Rémi Denis-Courmont

xkb: simplify keycode offset

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a9009c3c499ec0b96230053e80e34051c72afacb
---

 modules/video_output/wayland/input.c | 2 +-
 modules/video_output/xcb/window.c    | 2 +-
 modules/video_output/xcb/xkb.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/wayland/input.c b/modules/video_output/wayland/input.c
index 8147df1d2f..7627e48789 100644
--- a/modules/video_output/wayland/input.c
+++ b/modules/video_output/wayland/input.c
@@ -298,7 +298,7 @@ static void keyboard_key_cb(void *data, struct wl_keyboard *keyboard,
     if (unlikely(sd->keystate == NULL))
         return;
 
-    vk = vlc_xkb_get_one(sd->keystate, keycode);
+    vk = vlc_xkb_get_one(sd->keystate, keycode + 8);
     if (vk)
     {
         msg_Dbg(wnd, "key: 0x%08"PRIxFAST32" (XKB: 0x%04"PRIx32")",
diff --git a/modules/video_output/xcb/window.c b/modules/video_output/xcb/window.c
index 28caeafc32..134d313c12 100644
--- a/modules/video_output/xcb/window.c
+++ b/modules/video_output/xcb/window.c
@@ -233,7 +233,7 @@ static int ProcessEvent(vout_window_t *wnd, xcb_generic_event_t *ev)
         {
 #ifdef HAVE_XCB_XKB
             xcb_key_press_event_t *e = (xcb_key_press_event_t *)ev;
-            uint_fast32_t vk = vlc_xkb_get_one(sys->xkb.state, e->detail - 8);
+            uint_fast32_t vk = vlc_xkb_get_one(sys->xkb.state, e->detail);
 
             msg_Dbg(wnd, "key: 0x%08"PRIxFAST32" (X11: 0x%04"PRIx32")",
                     vk, e->detail);
diff --git a/modules/video_output/xcb/xkb.c b/modules/video_output/xcb/xkb.c
index 31c104e201..35384ee4c7 100644
--- a/modules/video_output/xcb/xkb.c
+++ b/modules/video_output/xcb/xkb.c
@@ -109,7 +109,7 @@ static const struct modifiers modifiers[] =
 
 uint_fast32_t vlc_xkb_get_one(struct xkb_state *state, uint_fast32_t keycode)
 {
-    xkb_keysym_t keysym = xkb_state_key_get_one_sym(state, keycode + 8);
+    xkb_keysym_t keysym = xkb_state_key_get_one_sym(state, keycode);
     uint_fast32_t vk = vlc_xkb_convert_keysym(keysym);
 
     if (vk != KEY_UNSET)



More information about the vlc-commits mailing list