[vlc-devel] [PATCH] xkb: fix capitalization

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Wed Nov 28 15:12:23 CET 2018


The core expects keycodes to be all lowercase. If the shift key is
pressed, then the keycode will contain the SHIFT modifier.
xkb_state_key_get_one_sym performs capitalization, because of this all
actions having SHIFT in their mapped keycode were not triggered.
---
 modules/video_output/xcb/xkb.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/xcb/xkb.c b/modules/video_output/xcb/xkb.c
index 35384ee4c7..813ee8e79e 100644
--- a/modules/video_output/xcb/xkb.c
+++ b/modules/video_output/xcb/xkb.c
@@ -32,6 +32,9 @@
 #include <vlc_actions.h>
 #include "video_output/xcb/vlc_xkb.h"
 
+#ifdef HAVE_XKBCOMMON
+# include <xkbcommon/xkbcommon.h>
+
 static int keysymcmp (const void *pa, const void *pb)
 {
     int a = *(const uint32_t *)pa;
@@ -54,7 +57,7 @@ static uint_fast32_t vlc_xkb_convert_keysym(uint_fast32_t sym)
 
     /* X11 Latin-1 range */
     if (sym <= 0xff)
-        return sym;
+        return xkb_keysym_to_lower(sym);
     /* X11 Unicode range */
     if (sym >= 0x1000100 && sym <= 0x110ffff)
         return sym - 0x1000000;
@@ -90,9 +93,6 @@ static uint_fast32_t vlc_xkb_convert_keysym(uint_fast32_t sym)
     return KEY_UNSET;
 }
 
-#ifdef HAVE_XKBCOMMON
-# include <xkbcommon/xkbcommon.h>
-
 struct modifiers
 {
     char name[8];
-- 
2.19.1



More information about the vlc-devel mailing list