From 49292705a9a0ff564a4686dc2eda63c7a27b8f6a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 8 Jan 2017 20:03:18 -0800 Subject: [PATCH] Fixed bug 3545 - SDL_EVDEV_do_text_input() may be too eager to find error cases Rob I've ran into an issue where I successfully receive SDL_KEY[UP,DOWN] events but not SDL_TEXTINPUT or SDL_TEXTEDITING. In my case the code in SDL_EVDEV_do_text_input() is returning early (on error) prior to calling SDL_SendKeyboardText(). I'm running on the RaspberryPi 3, without X11. In SDL_EVDEV_do_text_input() there is a condition to check keysyms with a type value below 0xf0, then subtract 0xf0 from type. Without understanding the purpose of this code, I disabled it, recompiled, and I'm getting correct SDL_TEXTINPUT events. I'm going to guess that my hack/fix is going to be problematic in some other environment, but after some initial testing it looks like everything is running fine in my setup. --- src/core/linux/SDL_evdev.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/linux/SDL_evdev.c b/src/core/linux/SDL_evdev.c index 3d1596165..284ce0bdd 100644 --- a/src/core/linux/SDL_evdev.c +++ b/src/core/linux/SDL_evdev.c @@ -289,6 +289,12 @@ static void SDL_EVDEV_do_text_input(unsigned short keycode) return; } + if (kbe.kb_value == K_HOLE || kbe.kb_value == K_NOSUCHMAP) { + return; + } + + kbe.kb_value ^= 0xf000; + type = KTYP(kbe.kb_value); if (type < 0xf0) {