diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/action.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/apps/action.c b/apps/action.c index 02991c0127..f65736c874 100644 --- a/apps/action.c +++ b/apps/action.c | |||
@@ -5,9 +5,10 @@ | |||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | ||
8 | * | 9 | * |
9 | * Copyright (C) 2006 Jonathan Gordon | 10 | * Copyright (C) 2006 Jonathan Gordon |
10 | * | 11 | * |
11 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
12 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
13 | * | 14 | * |
@@ -28,7 +29,9 @@ | |||
28 | bool ignore_until_release = false; | 29 | bool ignore_until_release = false; |
29 | int last_button = BUTTON_NONE; | 30 | int last_button = BUTTON_NONE; |
30 | int soft_unlock_action = ACTION_NONE; | 31 | int soft_unlock_action = ACTION_NONE; |
32 | #if (BUTTON_REMOTE != 0) | ||
31 | bool allow_remote_actions = true; | 33 | bool allow_remote_actions = true; |
34 | #endif | ||
32 | /* | 35 | /* |
33 | * do_button_check is the worker function for get_default_action. | 36 | * do_button_check is the worker function for get_default_action. |
34 | * returns ACTION_UNKNOWN or the requested return value from the list. | 37 | * returns ACTION_UNKNOWN or the requested return value from the list. |
@@ -111,12 +114,13 @@ int get_action_worker(int context, int timeout, | |||
111 | /*last_button = BUTTON_NONE; this is done by action_signalscreenchange() */ | 114 | /*last_button = BUTTON_NONE; this is done by action_signalscreenchange() */ |
112 | return ACTION_UNKNOWN; /* "safest" return value */ | 115 | return ACTION_UNKNOWN; /* "safest" return value */ |
113 | } | 116 | } |
114 | 117 | #if (BUTTON_REMOTE != 0) | |
115 | if (soft_unlock_action != ACTION_NONE) | 118 | if (soft_unlock_action != ACTION_NONE) |
116 | { | 119 | { |
117 | if ((button&BUTTON_REMOTE) && !allow_remote_actions) | 120 | if ((button&BUTTON_REMOTE) && !allow_remote_actions) |
118 | return ACTION_NONE; | 121 | return ACTION_NONE; |
119 | } | 122 | } |
123 | #endif | ||
120 | /* logf("%x,%x",last_button,button); */ | 124 | /* logf("%x,%x",last_button,button); */ |
121 | do | 125 | do |
122 | { | 126 | { |
@@ -149,16 +153,24 @@ int get_action_worker(int context, int timeout, | |||
149 | 153 | ||
150 | if (soft_unlock_action != ACTION_NONE) | 154 | if (soft_unlock_action != ACTION_NONE) |
151 | { | 155 | { |
156 | #if (BUTTON_REMOTE != 0) | ||
152 | if ((button&BUTTON_REMOTE) == 0) | 157 | if ((button&BUTTON_REMOTE) == 0) |
153 | { | 158 | { |
159 | #endif | ||
154 | if (soft_unlock_action == ret) | 160 | if (soft_unlock_action == ret) |
155 | { | 161 | { |
156 | soft_unlock_action = ACTION_NONE; | 162 | soft_unlock_action = ACTION_NONE; |
157 | ret = ACTION_NONE; /* no need to return the code */ | 163 | ret = ACTION_NONE; /* no need to return the code */ |
158 | } | 164 | } |
165 | #if (BUTTON_REMOTE != 0) | ||
159 | } | 166 | } |
160 | else if (!allow_remote_actions) | 167 | else if (!allow_remote_actions) |
168 | { | ||
161 | ret = ACTION_NONE; | 169 | ret = ACTION_NONE; |
170 | } | ||
171 | #else | ||
172 | else ret = ACTION_NONE; /* eat the button */ | ||
173 | #endif | ||
162 | } | 174 | } |
163 | 175 | ||
164 | last_button = button; | 176 | last_button = button; |
@@ -198,6 +210,10 @@ void action_signalscreenchange(void) | |||
198 | void action_setsoftwarekeylock(int unlock_action, bool allow_remote) | 210 | void action_setsoftwarekeylock(int unlock_action, bool allow_remote) |
199 | { | 211 | { |
200 | soft_unlock_action = unlock_action; | 212 | soft_unlock_action = unlock_action; |
213 | #if (BUTTON_REMOTE != 0) | ||
201 | allow_remote_actions = allow_remote; | 214 | allow_remote_actions = allow_remote; |
215 | #else | ||
216 | (void)allow_remote; /* kill the warning */ | ||
217 | #endif | ||
202 | last_button = BUTTON_NONE; | 218 | last_button = BUTTON_NONE; |
203 | } | 219 | } |