Skip to content
Permalink
Browse files

Fixed bug 4094 - No SDL_TEXTEDITING after pressing Alt key on Raspber…

…ry 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...
  • Loading branch information
slouken committed Jun 14, 2018
1 parent 12ff19c commit 9924a8e392a7d69c4f98d0e570e552ccf2a9e809
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/core/linux/SDL_evdev_kbd.c
@@ -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;
}

0 comments on commit 9924a8e

Please sign in to comment.