[vlc-commits] xkb: report lower case key presses
Rémi Denis-Courmont
git at videolan.org
Wed Jun 19 20:12:53 CEST 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jun 19 21:06:21 2019 +0300| [5061d405a093483d558d7667dc517ebebf0e66ba] | committer: Rémi Denis-Courmont
xkb: report lower case key presses
...as is VLC core convention.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5061d405a093483d558d7667dc517ebebf0e66ba
---
modules/video_output/xcb/xkb.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/video_output/xcb/xkb.c b/modules/video_output/xcb/xkb.c
index 35384ee4c7..70a2e598a1 100644
--- a/modules/video_output/xcb/xkb.c
+++ b/modules/video_output/xcb/xkb.c
@@ -26,6 +26,7 @@
#include <stdlib.h>
#include <stdint.h>
+#include <wctype.h>
#include <X11/keysym.h>
#include <X11/XF86keysym.h>
#include <vlc_common.h>
@@ -112,11 +113,15 @@ 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);
uint_fast32_t vk = vlc_xkb_convert_keysym(keysym);
- if (vk != KEY_UNSET)
+ if (vk != KEY_UNSET) {
+ if (vk < 0x110000)
+ vk = towlower(vk); /* Lower case for Unicode code points */
+
for (size_t i = 0; i < ARRAY_SIZE(modifiers); i++)
if (xkb_state_mod_name_is_active(state, modifiers[i].name,
XKB_STATE_MODS_EFFECTIVE) > 0)
vk |= modifiers[i].mask;
+ }
return vk;
}
More information about the vlc-commits
mailing list