summaryrefslogtreecommitdiffstats
path: root/uisimulator/sdl
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2006-03-24 13:47:24 +0000
committerBjörn Stenberg <bjorn@haxx.se>2006-03-24 13:47:24 +0000
commitda5fb18bca90ec09b99f28186787d10378a92109 (patch)
tree606690b331740a1a1f022cb8f5fce71fa06ddd10 /uisimulator/sdl
parent86f1e2ead283d86f6896ca0f98c0b711da5e2cfe (diff)
downloadrockbox-da5fb18bca90ec09b99f28186787d10378a92109.tar.gz
rockbox-da5fb18bca90ec09b99f28186787d10378a92109.zip
New option: First keypress enables backlight only. Patch #2920 by Nicolas Pennequin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9228 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/sdl')
-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;
static int btn = 0; /* Hopefully keeps track of currently pressed keys... */
+#ifdef CONFIG_BACKLIGHT
+static bool filter_first_keypress;
+
+void set_backlight_filter_keypress(bool value)
+{
+ filter_first_keypress = value;
+}
+#endif
+
void button_event(int key, bool pressed)
{
int new_btn = 0;
@@ -219,7 +228,10 @@ void button_event(int key, bool pressed)
}
else
{
- queue_post(&button_queue, btn, NULL);
+#ifdef CONFIG_BACKLIGHT
+ if ( !filter_first_keypress || is_backlight_on())
+#endif
+ queue_post(&button_queue, btn, NULL);
post = false;
}