1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Björn Stenberg 2006-03-24 13:47:24 +00:00
parent 86f1e2ead2
commit da5fb18bca
9 changed files with 74 additions and 2 deletions

View file

@ -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;
}