From 41967e503c06961c05c8a9895de6124630963325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Mon, 11 Apr 2022 15:56:19 -0500 Subject: [PATCH] wpesrc: Convert from utf32 to support other keys This makes all of the non-letter keys work. Part-of: --- .../gst-plugins-bad/ext/wpe/gstwpevideosrc.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/ext/wpe/gstwpevideosrc.cpp b/subprojects/gst-plugins-bad/ext/wpe/gstwpevideosrc.cpp index 693a859bb8..3de0e966d0 100644 --- a/subprojects/gst-plugins-bad/ext/wpe/gstwpevideosrc.cpp +++ b/subprojects/gst-plugins-bad/ext/wpe/gstwpevideosrc.cpp @@ -586,10 +586,18 @@ gst_wpe_video_src_event (GstBaseSrc * base_src, GstEvent * event) if (gst_navigation_event_parse_key_event (event, &key)) { /* FIXME: This is wrong... The GstNavigation API should pass hardware-level information, not high-level keysym strings */ - uint32_t keysym = - (uint32_t) xkb_keysym_from_name (key, XKB_KEYSYM_NO_FLAGS); + gunichar *unichar; + glong items_written; + uint32_t keysym; struct wpe_input_keyboard_event wpe_event = { 0 }; + unichar = g_utf8_to_ucs4_fast (key, -1, &items_written); + if (items_written == 1) + keysym = (uint32_t) xkb_utf32_to_keysym (*unichar); + else + keysym = + (uint32_t) xkb_keysym_from_name (key, XKB_KEYSYM_NO_FLAGS); + wpe_event.key_code = keysym; wpe_event.pressed = gst_navigation_event_get_type (event) ==