[vlc-commits] xcb: fix X11 key table ordering
Rémi Denis-Courmont
git at videolan.org
Thu Apr 25 21:44:55 CEST 2013
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Apr 25 22:40:42 2013 +0300| [711e7b044cd0d49010117c543c8c60c30fca6b71] | committer: Rémi Denis-Courmont
xcb: fix X11 key table ordering
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=711e7b044cd0d49010117c543c8c60c30fca6b71
---
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 6c543b1..2b91c7e 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 e0892af..430ef37 100644
--- a/modules/video_output/xcb/xcb_keysym.h
+++ b/modules/video_output/xcb/xcb_keysym.h
@@ -38,7 +38,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, ',', },
@@ -55,6 +54,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