summaryrefslogtreecommitdiff
path: root/apps/action.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/action.c')
-rw-r--r--apps/action.c26
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,
63{ 63{
64 int i = 0; 64 int i = 0;
65 int ret = ACTION_UNKNOWN; 65 int ret = ACTION_UNKNOWN;
66 if (items == NULL)
67 return ACTION_UNKNOWN;
68 66
69 while (items[i].button_code != BUTTON_NONE) 67 while (items[i].button_code != BUTTON_NONE)
70 { 68 {
@@ -192,7 +190,7 @@ static int get_action_worker(int context, int timeout,
192#endif /* HAS_BUTTON_HOLD */ 190#endif /* HAS_BUTTON_HOLD */
193 191
194 /* logf("%x,%x",last_button,button); */ 192 /* logf("%x,%x",last_button,button); */
195 do 193 while (1)
196 { 194 {
197 /* logf("context = %x",context); */ 195 /* logf("context = %x",context); */
198#if (BUTTON_REMOTE != 0) 196#if (BUTTON_REMOTE != 0)
@@ -204,19 +202,25 @@ static int get_action_worker(int context, int timeout,
204 else 202 else
205 items = get_context_mapping(context); 203 items = get_context_mapping(context);
206 204
207 ret = do_button_check(items,button,last_button,&i); 205 if (items == NULL)
208
209 if ((context ==(int)CONTEXT_STOPSEARCHING) ||
210 items == NULL )
211 break; 206 break;
212 207
213 if (ret == ACTION_UNKNOWN ) 208 ret = do_button_check(items,button,last_button,&i);
209
210 if (ret == ACTION_UNKNOWN)
214 { 211 {
215 context = get_next_context(items,i); 212 context = get_next_context(items,i);
216 i = 0; 213
214 if (context != (int)CONTEXT_STOPSEARCHING)
215 {
216 i = 0;
217 continue;
218 }
217 } 219 }
218 else break; 220
219 } while (1); 221 /* Action was found or STOPSEARCHING was specified */
222 break;
223 }
220 /* DEBUGF("ret = %x\n",ret); */ 224 /* DEBUGF("ret = %x\n",ret); */
221#ifndef HAS_BUTTON_HOLD 225#ifndef HAS_BUTTON_HOLD
222 if (screen_has_lock && (ret == ACTION_STD_KEYLOCK)) 226 if (screen_has_lock && (ret == ACTION_STD_KEYLOCK))