diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-07-22 06:05:53 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-07-22 06:05:53 +0000 |
| commit | f7675a244b0d1d52bfdf5a1ee0051b46e73f9f2e (patch) | |
| tree | a24862b74e4a16e971349a4f4b2975b93e45d5b4 /apps/action.c | |
| parent | 9d756e2760a0926aa416b22e276c4a5b2685e84e (diff) | |
| download | rockbox-f7675a244b0d1d52bfdf5a1ee0051b46e73f9f2e.zip rockbox-f7675a244b0d1d52bfdf5a1ee0051b46e73f9f2e.tar.gz rockbox-f7675a244b0d1d52bfdf5a1ee0051b46e73f9f2e.tar.bz2 rockbox-f7675a244b0d1d52bfdf5a1ee0051b46e73f9f2e.tar.xz | |
remove the need for action_signalscreenchange().
Fixes problems with targets where the ACTION_STD_CANCEL event is a combo
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13956 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/action.c')
| -rw-r--r-- | apps/action.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/apps/action.c b/apps/action.c index d9f04a8..826f376 100644 --- a/apps/action.c +++ b/apps/action.c @@ -29,8 +29,8 @@ #include "debug.h" #include "splash.h" -static bool ignore_until_release = false; -static int last_button = BUTTON_NONE; +static int last_button = BUTTON_NONE|BUTTON_REL; /* allow the ipod wheel to + work on startup */ static int last_action = ACTION_NONE; static bool repeated = false; @@ -104,6 +104,7 @@ static int get_action_worker(int context, int timeout, int button; int i=0; int ret = ACTION_UNKNOWN; + static int last_context = CONTEXT_STD; if (timeout == TIMEOUT_NOBLOCK) button = button_get(false); @@ -117,14 +118,18 @@ static int get_action_worker(int context, int timeout, return button; } - if (ignore_until_release == true) + if ((context != last_context) && ((last_button&BUTTON_REL) == 0)) { if (button&BUTTON_REL) { - ignore_until_release = false; + last_button = button; + last_action = ACTION_NONE; } + /* eat all buttons until the previous button was |BUTTON_REL + (also eat the |BUTTON_REL button) */ return ACTION_NONE; /* "safest" return value */ } + last_context = context; #ifndef HAS_BUTTON_HOLD screen_has_lock = ((context&ALLOW_SOFTLOCK)==ALLOW_SOFTLOCK); @@ -182,7 +187,6 @@ static int get_action_worker(int context, int timeout, { unlock_combo = button; keys_locked = true; - action_signalscreenchange(); gui_syncsplash(HZ/2, str(LANG_KEYLOCK_ON_PLAYER)); button_clear_queue(); @@ -214,22 +218,11 @@ int get_custom_action(int context,int timeout, bool action_userabort(int timeout) { - action_signalscreenchange(); int action = get_action_worker(CONTEXT_STD,timeout,NULL); bool ret = (action == ACTION_STD_CANCEL); - action_signalscreenchange(); return ret; } -void action_signalscreenchange(void) -{ - if ((last_button != BUTTON_NONE) && - !(last_button&BUTTON_REL)) - { - ignore_until_release = true; - } - last_button = BUTTON_NONE; -} #ifndef HAS_BUTTON_HOLD bool is_keys_locked(void) { @@ -247,7 +240,5 @@ int get_action_statuscode(int *button) ret |= ACTION_REMOTE; if (repeated) ret |= ACTION_REPEAT; - if (ignore_until_release) - ret |= ACTION_IGNORING; return ret; } |