Fixed bug 4094 - No SDL_TEXTEDITING after pressing Alt key on Raspberry Pi Linux

This was reproducible by running an SDL app on the console from an ssh login. In this case the terminal wasn't owned by the user running the app, so we were using the default keymap, which didn't have state transitions defined for ctrl and alt, so once we entered that state keypresses would no longer transition out of that state, nor would they generate text.

As a workaround, we'll just reset to the default shift state if that happens, which means we'll get text for keys pressed while ctrl is held down, but I don't think that's a big problem.

Note that in this case we also can't mute the keyboard, so the keypresses go to the console, which probably isn't what you want...
This commit is contained in:
Sam Lantinga 2018-06-14 00:51:45 -07:00
parent 12ff19c035
commit 9924a8e392

View File

@ -609,7 +609,10 @@ SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *kbd, unsigned int keycode, int d
shift_final = (kbd->shift_state | kbd->slockstate) ^ kbd->lockstate;
key_map = kbd->key_maps[shift_final];
if (!key_map) {
/* Unsupported shift state (e.g. ctrl = 4, alt = 8), just reset to the default state */
kbd->shift_state = 0;
kbd->slockstate = 0;
kbd->lockstate = 0;
return;
}