Fix the bug where the short-long fwd/back action would ffwd/rewind the next folder (consult the manual if that makes no sense)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21619 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c41f13f7d8
commit
0e445fcef6
3 changed files with 29 additions and 0 deletions
|
@ -40,6 +40,7 @@ static int last_button = BUTTON_NONE|BUTTON_REL; /* allow the ipod wheel to
|
|||
static intptr_t last_data = 0;
|
||||
static int last_action = ACTION_NONE;
|
||||
static bool repeated = false;
|
||||
static bool wait_for_release = false;
|
||||
|
||||
#ifdef HAVE_TOUCHSCREEN
|
||||
static bool short_press = false;
|
||||
|
@ -127,6 +128,16 @@ static int get_action_worker(int context, int timeout,
|
|||
/* Data from sys events can be pulled with button_get_data */
|
||||
if (button == BUTTON_NONE || button & SYS_EVENT)
|
||||
return button;
|
||||
/* Don't send any buttons through untill we see the release event */
|
||||
if (wait_for_release)
|
||||
{
|
||||
if (button&BUTTON_REL)
|
||||
{
|
||||
wait_for_release = false;
|
||||
}
|
||||
return ACTION_NONE;
|
||||
}
|
||||
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* Produce keyclick */
|
||||
|
@ -329,3 +340,13 @@ int action_get_touchscreen_press(short *x, short *y)
|
|||
return BUTTON_TOUCHSCREEN;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Don't let get_action*() return any ACTION_* values untill the current buttons
|
||||
* have ben release. SYS_* and BUTTON_NONE will go through.
|
||||
* Any actions relying on _RELEASE won't get seen
|
||||
*/
|
||||
void action_wait_for_release(void)
|
||||
{
|
||||
wait_for_release = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -295,4 +295,10 @@ intptr_t get_action_data(void);
|
|||
int action_get_touchscreen_press(short *x, short *y);
|
||||
#endif
|
||||
|
||||
/* Don't let get_action*() return any ACTION_* values untill the current buttons
|
||||
* have ben release. SYS_* and BUTTON_NONE will go through.
|
||||
* Any actions relying on _RELEASE won't get seen
|
||||
*/
|
||||
void action_wait_for_release(void);
|
||||
|
||||
#endif /* __ACTION_H__ */
|
||||
|
|
|
@ -135,6 +135,8 @@ static void change_dir(int direction)
|
|||
audio_prev_dir();
|
||||
else if (direction > 0)
|
||||
audio_next_dir();
|
||||
/* prevent the next dir to immediatly start being ffw'd */
|
||||
action_wait_for_release();
|
||||
}
|
||||
|
||||
static void prev_track(unsigned long skip_thresh)
|
||||
|
|
Loading…
Reference in a new issue