Skip to content

Commit

Permalink
Touchscreen targets: fix software hold not locking touchscreen
Browse files Browse the repository at this point in the history
Flyspray: FS#10733
Author: Yann Muller

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23384 a1c6a512-1295-4272-9138-f99709370657
  • Loading branch information
mcuelenaere committed Oct 28, 2009
1 parent eaa3741 commit d8b59f9
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions apps/action.c
Expand Up @@ -202,25 +202,6 @@ static int get_action_worker(int context, int timeout,
return ACTION_NONE; /* "safest" return value */
}
last_context = context;
#ifdef HAVE_TOUCHSCREEN
if (button & BUTTON_TOUCHSCREEN)
{
repeated = false;
short_press = false;
if (last_button & BUTTON_TOUCHSCREEN)
{
if ((button & BUTTON_REL) &&
((last_button & BUTTON_REPEAT)==0))
{
short_press = true;
}
else if (button & BUTTON_REPEAT)
repeated = true;
}
last_button = button;
return ACTION_TOUCHSCREEN;
}
#endif
#ifndef HAS_BUTTON_HOLD
screen_has_lock = ((context & ALLOW_SOFTLOCK) == ALLOW_SOFTLOCK);
if (screen_has_lock && keys_locked)
Expand All @@ -245,6 +226,26 @@ static int get_action_worker(int context, int timeout,
context &= ~ALLOW_SOFTLOCK;
#endif /* HAS_BUTTON_HOLD */

#ifdef HAVE_TOUCHSCREEN
if (button & BUTTON_TOUCHSCREEN)
{
repeated = false;
short_press = false;
if (last_button & BUTTON_TOUCHSCREEN)
{
if ((button & BUTTON_REL) &&
((last_button & BUTTON_REPEAT)==0))
{
short_press = true;
}
else if (button & BUTTON_REPEAT)
repeated = true;
}
last_button = button;
return ACTION_TOUCHSCREEN;
}
#endif

#if defined(HAVE_LCD_BITMAP) && !defined(BOOTLOADER)
button = button_flip_horizontally(context, button);
#endif
Expand Down

0 comments on commit d8b59f9

Please sign in to comment.