[vlc-commits] xcb: fix X11 key table ordering

Rémi Denis-Courmont git at videolan.org
Thu Apr 25 21:47:27 CEST 2013


vlc/vlc-2.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 25 22:40:42 2013 +0300| [d70eac525d4d789f099c0bf3c1a284601a61e653] | committer: Rémi Denis-Courmont

xcb: fix X11 key table ordering

(cherry picked from commit 711e7b044cd0d49010117c543c8c60c30fca6b71)

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

 modules/video_output/xcb/keys.c       |   17 +++++++++++++++++
 modules/video_output/xcb/xcb_keysym.h |    2 +-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/xcb/keys.c b/modules/video_output/xcb/keys.c
index 265f101..0f625da 100644
--- a/modules/video_output/xcb/keys.c
+++ b/modules/video_output/xcb/keys.c
@@ -97,6 +97,23 @@ static uint_fast32_t ConvertKeySym (xcb_keysym_t sym)
     if (sym >= 0x1000100 && sym <= 0x110ffff)
         return sym - 0x1000000;
 
+#if 0
+    for (size_t i = 0; i < sizeof (tab) / sizeof (tab[0]); i++)
+        if (i > 0 && tab[i-1].x11 >= tab[i].x11)
+        {
+            fprintf (stderr, "key %x and %x are not ordered properly\n",
+                     tab[i-1].x11, tab[i].x11);
+            abort ();
+        }
+    for (size_t i = 0; i < sizeof (old) / sizeof (old[0]); i++)
+        if (i > 0 && old[i-1].x11 >= old[i].x11)
+        {
+            fprintf (stderr, "key %x and %x are not ordered properly\n",
+                     old[i-1].x11, old[i].x11);
+            abort ();
+        }
+#endif
+
     /* Special keys */
     res = bsearch (&sym, tab, sizeof (tab) / sizeof (tab[0]), sizeof (tab[0]),
                    keysymcmp);
diff --git a/modules/video_output/xcb/xcb_keysym.h b/modules/video_output/xcb/xcb_keysym.h
index 51797eb..3221677 100644
--- a/modules/video_output/xcb/xcb_keysym.h
+++ b/modules/video_output/xcb/xcb_keysym.h
@@ -37,7 +37,6 @@
         { XK_KP_Begin,      KEY_HOME, }, /* KP middle (5 without numlock) */
         { XK_KP_Insert,     KEY_INSERT, },
         { XK_KP_Delete,     KEY_DELETE, },
-        { XK_KP_Equal,      '=', },
         { XK_KP_Multiply,   '*', },
         { XK_KP_Add,        '+', },
         { XK_KP_Separator,  ',', },
@@ -54,6 +53,7 @@
         { XK_KP_7,          '7', },
         { XK_KP_8,          '8', },
         { XK_KP_9,          '9', },
+        { XK_KP_Equal,      '=', },
 
         { XK_F1,            KEY_F1, },
         { XK_F2,            KEY_F2, },



More information about the vlc-commits mailing list