summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/button.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/sdl/button.c')
-rw-r--r--uisimulator/sdl/button.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/uisimulator/sdl/button.c b/uisimulator/sdl/button.c
index 00a329924e..bf0396e18d 100644
--- a/uisimulator/sdl/button.c
+++ b/uisimulator/sdl/button.c
@@ -37,6 +37,15 @@ struct event_queue button_queue;
37 37
38static int btn = 0; /* Hopefully keeps track of currently pressed keys... */ 38static int btn = 0; /* Hopefully keeps track of currently pressed keys... */
39 39
40#ifdef CONFIG_BACKLIGHT
41static bool filter_first_keypress;
42
43void set_backlight_filter_keypress(bool value)
44{
45 filter_first_keypress = value;
46}
47#endif
48
40void button_event(int key, bool pressed) 49void button_event(int key, bool pressed)
41{ 50{
42 int new_btn = 0; 51 int new_btn = 0;
@@ -219,7 +228,10 @@ void button_event(int key, bool pressed)
219 } 228 }
220 else 229 else
221 { 230 {
222 queue_post(&button_queue, btn, NULL); 231#ifdef CONFIG_BACKLIGHT
232 if ( !filter_first_keypress || is_backlight_on())
233#endif
234 queue_post(&button_queue, btn, NULL);
223 post = false; 235 post = false;
224 } 236 }
225 237