summaryrefslogtreecommitdiff
path: root/apps/action.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/action.c')
-rw-r--r--apps/action.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/action.c b/apps/action.c
index f493296..ee84706 100644
--- a/apps/action.c
+++ b/apps/action.c
@@ -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;
+}
+