[vlc-devel] [vlc-commits] xkb: report lower case key presses
Thomas Guillem
thomas at gllm.fr
Thu Jun 20 08:22:59 CEST 2019
Fixes #22446
Thanks !
On Wed, Jun 19, 2019, at 20:27, Rémi Denis-Courmont wrote:
> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jun
> 19 21:06:21 2019 +0300| [9b2a2434fd341e6c58d4169b47ead5332ff7bdc9] |
> 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=9b2a2434fd341e6c58d4169b47ead5332ff7bdc9
> ---
>
> 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;
> }
>
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits
>
More information about the vlc-devel
mailing list