diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2009-02-03 10:55:30 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2009-02-03 10:55:30 +0000 |
commit | e2a169bce53aff3e5fc300c00d3828129298d469 (patch) | |
tree | 94ebf4cc62c4a32d133ab1b6013363ad283981e8 /apps/action.c | |
parent | af5c4d1b272e1e05523e8ffdd0733104eaa3e199 (diff) | |
download | rockbox-e2a169bce53aff3e5fc300c00d3828129298d469.tar.gz rockbox-e2a169bce53aff3e5fc300c00d3828129298d469.zip |
Gigabeat S: Get remote keymaps up to snuff and working. Do a couple tweaks on main unit ones. Cleanup keymap file a bit. Fix main button scanner to not clobber remote button. Fix a bug in actions.c where 'LAST_ITEM_IN_LIST' didn't really terminate scanning immediately. It would do an additional call into get_context_map and silently pick up ACTION_STD.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19909 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/action.c')
-rw-r--r-- | apps/action.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/apps/action.c b/apps/action.c index d98bf13cf3..8a72dcdce7 100644 --- a/apps/action.c +++ b/apps/action.c @@ -63,8 +63,6 @@ static inline int do_button_check(const struct button_mapping *items, { int i = 0; int ret = ACTION_UNKNOWN; - if (items == NULL) - return ACTION_UNKNOWN; while (items[i].button_code != BUTTON_NONE) { @@ -192,7 +190,7 @@ static int get_action_worker(int context, int timeout, #endif /* HAS_BUTTON_HOLD */ /* logf("%x,%x",last_button,button); */ - do + while (1) { /* logf("context = %x",context); */ #if (BUTTON_REMOTE != 0) @@ -204,19 +202,25 @@ static int get_action_worker(int context, int timeout, else items = get_context_mapping(context); - ret = do_button_check(items,button,last_button,&i); - - if ((context ==(int)CONTEXT_STOPSEARCHING) || - items == NULL ) + if (items == NULL) break; - if (ret == ACTION_UNKNOWN ) + ret = do_button_check(items,button,last_button,&i); + + if (ret == ACTION_UNKNOWN) { context = get_next_context(items,i); - i = 0; + + if (context != (int)CONTEXT_STOPSEARCHING) + { + i = 0; + continue; + } } - else break; - } while (1); + + /* Action was found or STOPSEARCHING was specified */ + break; + } /* DEBUGF("ret = %x\n",ret); */ #ifndef HAS_BUTTON_HOLD if (screen_has_lock && (ret == ACTION_STD_KEYLOCK)) |