diff options
Diffstat (limited to 'firmware/target')
-rw-r--r-- | firmware/target/hosted/sdl/button-sdl.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/firmware/target/hosted/sdl/button-sdl.c b/firmware/target/hosted/sdl/button-sdl.c index 4fab9e85d8..9f1c1f7519 100644 --- a/firmware/target/hosted/sdl/button-sdl.c +++ b/firmware/target/hosted/sdl/button-sdl.c | |||
@@ -68,6 +68,9 @@ struct event_queue button_queue; | |||
68 | static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ | 68 | static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ |
69 | 69 | ||
70 | int sdl_app_has_input_focus = 1; | 70 | int sdl_app_has_input_focus = 1; |
71 | #if (CONFIG_PLATFORM & PLATFORM_MAEMO) | ||
72 | static int n900_updown_key_pressed = 0; | ||
73 | #endif | ||
71 | 74 | ||
72 | #ifdef HAS_BUTTON_HOLD | 75 | #ifdef HAS_BUTTON_HOLD |
73 | bool hold_button_state = false; | 76 | bool hold_button_state = false; |
@@ -230,8 +233,19 @@ static bool event_handler(SDL_Event *event) | |||
230 | #if (CONFIG_PLATFORM & PLATFORM_MAEMO5) | 233 | #if (CONFIG_PLATFORM & PLATFORM_MAEMO5) |
231 | /* N900 with shared up/down cursor mapping. Seen on the German, | 234 | /* N900 with shared up/down cursor mapping. Seen on the German, |
232 | Finnish, Italian, French and Russian version. Probably more. */ | 235 | Finnish, Italian, French and Russian version. Probably more. */ |
233 | if (event->key.keysym.mod & KMOD_MODE) | 236 | if (event->key.keysym.mod & KMOD_MODE || n900_updown_key_pressed) |
234 | { | 237 | { |
238 | /* Prevent stuck up/down keys: If you release the ALT key before the cursor key, | ||
239 | rockbox will see a KEYUP event for left/right instead of up/down and | ||
240 | the previously pressed up/down key would stay active. */ | ||
241 | if (ev_key == SDLK_LEFT || ev_key == SDLK_RIGHT) | ||
242 | { | ||
243 | if (event->type == SDL_KEYDOWN) | ||
244 | n900_updown_key_pressed = 1; | ||
245 | else | ||
246 | n900_updown_key_pressed = 0; | ||
247 | } | ||
248 | |||
235 | if (ev_key == SDLK_LEFT) | 249 | if (ev_key == SDLK_LEFT) |
236 | ev_key = SDLK_UP; | 250 | ev_key = SDLK_UP; |
237 | else if (ev_key == SDLK_RIGHT) | 251 | else if (ev_key == SDLK_RIGHT) |