Get the NSF internal playlists working again. Fix a few wrongdoings in the metadata...
[kugel-rb.git] / apps / keymaps / keymap-gigabeat-s.c
blob4cd76184ff6a9fb8049841653313d4fddb13cf36
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 Jonathan Gordon
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 /* Button Code Definitions for the toshiba gigabeat target */
23 #include <stdio.h>
24 #include <string.h>
25 #include <stdlib.h>
27 #include "config.h"
28 #include "action.h"
29 #include "button.h"
30 #include "settings.h"
33 * The format of the list is as follows
34 * { Action Code, Button code, Prereq button code }
35 * if there's no need to check the previous button's value, use BUTTON_NONE
36 * Insert LAST_ITEM_IN_LIST at the end of each mapping
39 /* CONTEXT_CUSTOM's used in this file...
41 CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
42 CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens
43 i.e where up/down is inc/dec
44 CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec
49 static const struct button_mapping button_context_standard[] = {
50 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
51 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
52 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
53 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
55 { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
56 { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
57 { ACTION_STD_CANCEL, BUTTON_BACK, BUTTON_NONE },
59 { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
61 { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
62 { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
64 { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
65 { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
67 LAST_ITEM_IN_LIST
68 }; /* button_context_standard */
71 static const struct button_mapping button_context_wps[] = {
72 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
73 { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
75 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
76 { ACTION_WPS_SKIPNEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
77 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
78 { ACTION_WPS_SKIPPREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
80 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
81 { ACTION_WPS_SEEKBACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
82 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
83 { ACTION_WPS_SEEKFWD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
84 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
85 { ACTION_WPS_STOPSEEK, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT },
86 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
87 { ACTION_WPS_STOPSEEK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT },
89 { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_BACK|BUTTON_RIGHT, BUTTON_BACK },
90 { ACTION_WPS_ABSETA_PREVDIR, BUTTON_BACK|BUTTON_LEFT, BUTTON_BACK },
91 { ACTION_WPS_ABRESET, BUTTON_BACK|BUTTON_SELECT, BUTTON_BACK },
93 { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
94 { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
95 { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
96 { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
97 { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
98 { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
99 { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
100 { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
102 { ACTION_WPS_PITCHSCREEN, BUTTON_BACK|BUTTON_UP, BUTTON_BACK },
103 { ACTION_WPS_VIEW_PLAYLIST, BUTTON_BACK|BUTTON_DOWN, BUTTON_NONE },
105 { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
106 { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
107 { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
109 { ACTION_WPS_HOTKEY, BUTTON_BACK|BUTTON_MENU, BUTTON_NONE },
110 { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
112 LAST_ITEM_IN_LIST
113 }; /* button_context_wps */
115 static const struct button_mapping button_context_list[] = {
116 { ACTION_LISTTREE_PGUP, BUTTON_BACK|BUTTON_UP, BUTTON_NONE },
117 { ACTION_LISTTREE_PGUP, BUTTON_BACK|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
118 { ACTION_LISTTREE_PGDOWN, BUTTON_BACK|BUTTON_DOWN, BUTTON_NONE },
119 { ACTION_LISTTREE_PGDOWN, BUTTON_BACK|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
120 #ifdef HAVE_VOLUME_IN_LIST
121 { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
122 { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
123 { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
124 { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
125 #endif
127 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
128 }; /* button_context_list */
130 static const struct button_mapping button_context_tree[] = {
131 { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
132 { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE },
133 { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
134 { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE },
135 { ACTION_TREE_HOTKEY,BUTTON_BACK|BUTTON_MENU, BUTTON_NONE },
137 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST)
138 }; /* button_context_tree */
140 static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
141 { ACTION_NONE, BUTTON_BACK, BUTTON_NONE },
142 { ACTION_TREE_PGLEFT, BUTTON_BACK|BUTTON_LEFT, BUTTON_NONE },
143 { ACTION_TREE_ROOT_INIT, BUTTON_BACK|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_BACK|BUTTON_LEFT },
144 { ACTION_TREE_PGLEFT, BUTTON_BACK|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
145 { ACTION_TREE_PGRIGHT, BUTTON_BACK|BUTTON_RIGHT, BUTTON_NONE },
146 { ACTION_TREE_PGRIGHT, BUTTON_BACK|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
147 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
148 }; /* button_context_listtree_scroll_with_combo */
150 static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
151 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
152 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
153 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
154 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
155 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
156 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
157 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
158 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
159 }; /* button_context_listtree_scroll_without_combo */
161 static const struct button_mapping button_context_settings[] = {
162 { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
163 { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
164 { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
165 { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
166 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
167 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
168 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
169 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
170 { ACTION_SETTINGS_RESET, BUTTON_BACK, BUTTON_NONE },
172 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
173 }; /* button_context_settings */
175 static const struct button_mapping button_context_settings_right_is_inc[] = {
176 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
177 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
178 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
179 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
180 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
181 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
182 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
183 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
184 { ACTION_SETTINGS_RESET, BUTTON_BACK, BUTTON_NONE },
186 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
187 }; /* button_context_settingsgraphical */
189 static const struct button_mapping button_context_yesno[] = {
190 { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
192 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
193 }; /* button_context_settings_yesno */
195 static const struct button_mapping button_context_colorchooser[] = {
196 { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
197 { ACTION_STD_CANCEL, BUTTON_BACK, BUTTON_NONE },
199 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
200 }; /* button_context_colorchooser */
202 static const struct button_mapping button_context_eq[] = {
203 { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
205 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
206 }; /* button_context_eq */
208 /** Bookmark Screen **/
209 static const struct button_mapping button_context_bmark[] = {
210 { ACTION_BMS_DELETE, BUTTON_BACK|BUTTON_SELECT, BUTTON_BACK },
212 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
213 }; /* button_context_bmark */
215 static const struct button_mapping button_context_time[] = {
216 { ACTION_STD_CANCEL, BUTTON_BACK, BUTTON_NONE },
217 { ACTION_STD_OK, BUTTON_PLAY, BUTTON_NONE },
219 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
220 }; /* button_context_time */
222 static const struct button_mapping button_context_quickscreen[] = {
223 { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE },
224 { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
225 { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
226 { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
227 { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
228 { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
229 { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
230 { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
231 { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE },
233 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
234 }; /* button_context_quickscreen */
236 static const struct button_mapping button_context_pitchscreen[] = {
237 { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
238 { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
239 { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
240 { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
241 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
242 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
243 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
244 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
245 { ACTION_PS_TOGGLE_MODE, BUTTON_MENU, BUTTON_NONE },
246 { ACTION_PS_RESET, BUTTON_PLAY, BUTTON_NONE },
247 { ACTION_PS_EXIT, BUTTON_BACK, BUTTON_NONE },
248 { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
249 { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
251 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
252 }; /* button_context_pitchcreen */
254 /** Recording Screen **/
255 static const struct button_mapping button_context_recscreen[] = {
256 { ACTION_REC_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
257 { ACTION_STD_CANCEL, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
258 { ACTION_REC_NEWFILE, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
259 { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
260 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
261 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
262 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
263 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
264 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
265 { ACTION_STD_PREV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
266 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
267 { ACTION_STD_NEXT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
269 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
270 }; /* button_context_recscreen */
272 static const struct button_mapping button_context_keyboard[] = {
273 { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
274 { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
275 { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
276 { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
277 { ACTION_KBD_CURSOR_LEFT, BUTTON_PREV, BUTTON_NONE },
278 { ACTION_KBD_CURSOR_LEFT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
279 { ACTION_KBD_CURSOR_RIGHT, BUTTON_NEXT, BUTTON_NONE },
280 { ACTION_KBD_CURSOR_RIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
281 { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
282 { ACTION_KBD_PAGE_FLIP, BUTTON_BACK|BUTTON_MENU, BUTTON_NONE },
283 { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
284 { ACTION_KBD_ABORT, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
285 { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE },
286 { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
287 { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
288 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
289 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
290 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
291 { ACTION_KBD_MORSE_INPUT, BUTTON_BACK|BUTTON_VOL_UP, BUTTON_NONE },
292 { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
294 LAST_ITEM_IN_LIST
295 }; /* button_context_keyboard */
297 static const struct button_mapping button_context_radio[] = {
298 { ACTION_FM_MENU, BUTTON_SELECT | BUTTON_REPEAT, BUTTON_NONE },
299 { ACTION_FM_PRESET, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT },
300 { ACTION_FM_STOP, BUTTON_POWER, BUTTON_NONE },
301 { ACTION_FM_MODE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
302 { ACTION_FM_EXIT, BUTTON_BACK, BUTTON_NONE },
303 { ACTION_FM_PLAY, BUTTON_PLAY, BUTTON_NONE },
304 { ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE },
305 { ACTION_SETTINGS_INCREPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
306 { ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
307 { ACTION_SETTINGS_DECREPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
309 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
310 }; /* button_context_radio */
312 /*****************************************************************************
313 * Remote control mappings
314 *****************************************************************************/
315 static const struct button_mapping remote_button_context_standard[] = {
316 { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
317 { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
318 { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
319 { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
320 { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_DSP },
321 { ACTION_STD_QUICKSCREEN, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
322 { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
323 { ACTION_STD_MENU, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
324 { ACTION_STD_CONTEXT, BUTTON_RC_DSP|BUTTON_REPEAT, BUTTON_RC_DSP },
326 LAST_ITEM_IN_LIST
327 }; /* remote_button_context_standard */
329 static const struct button_mapping remote_button_context_wps[] = {
330 { ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
331 { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
332 { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
333 { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
334 { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
335 { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
336 { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
337 { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
338 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
339 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
340 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
341 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
342 { ACTION_WPS_MENU, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
343 { ACTION_WPS_CONTEXT, BUTTON_RC_DSP|BUTTON_REPEAT, BUTTON_RC_DSP },
345 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
346 }; /* remote_button_context_wps */
348 static const struct button_mapping remote_button_context_tree[] = {
349 { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
350 { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
351 { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
353 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
354 }; /* remote_button_context_tree */
356 static const struct button_mapping remote_button_context_radio[] = {
357 { ACTION_FM_MODE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
358 { ACTION_FM_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
359 { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE },
360 { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
361 { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE },
362 { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
363 { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
364 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
365 { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
366 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
367 { ACTION_FM_EXIT, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
368 { ACTION_FM_STOP, BUTTON_RC_DSP|BUTTON_REPEAT, BUTTON_RC_DSP },
370 LAST_ITEM_IN_LIST
371 }; /* remote_button_context_radio */
373 static const struct button_mapping remote_button_context_recscreen[] = {
374 { ACTION_REC_NEWFILE, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
375 { ACTION_REC_PAUSE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
376 { ACTION_STD_CANCEL, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
377 { ACTION_STD_MENU, BUTTON_RC_DSP|BUTTON_REPEAT, BUTTON_RC_DSP },
378 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
379 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
380 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
381 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
382 { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
383 { ACTION_STD_PREV, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
384 { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
385 { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
387 LAST_ITEM_IN_LIST
388 }; /* button_context_recscreen */
390 static const struct button_mapping remote_button_context_time[] = {
391 { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
392 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
393 { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
394 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
395 { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE },
396 { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
397 { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE },
398 { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
399 { ACTION_STD_OK, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
400 { ACTION_STD_CANCEL, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
402 LAST_ITEM_IN_LIST
403 }; /* remote_button_context_time */
405 static const struct button_mapping remote_button_context_bmark[] = {
406 { ACTION_BMS_DELETE, BUTTON_RC_DSP|BUTTON_REPEAT, BUTTON_RC_DSP },
408 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
409 }; /* remote_button_context_bmark */
411 static const struct button_mapping remote_button_context_yesno[] = {
412 { ACTION_YESNO_ACCEPT, BUTTON_RC_PLAY, BUTTON_NONE },
414 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
415 }; /* button_context_settings_yesno */
417 static const struct button_mapping remote_button_context_quickscreen[] = {
418 { ACTION_QS_TOP, BUTTON_RC_VOL_UP, BUTTON_NONE },
419 { ACTION_QS_TOP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
420 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
421 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
422 { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE },
423 { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
424 { ACTION_QS_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
425 { ACTION_QS_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
426 { ACTION_STD_CANCEL, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
428 LAST_ITEM_IN_LIST
429 }; /* remote_button_context_quickscreen */
431 static const struct button_mapping remote_button_context_pitchscreen[] = {
432 { ACTION_PS_INC_SMALL, BUTTON_RC_VOL_UP, BUTTON_NONE },
433 { ACTION_PS_INC_BIG, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
434 { ACTION_PS_DEC_SMALL, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
435 { ACTION_PS_DEC_BIG, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
436 { ACTION_PS_NUDGE_LEFT, BUTTON_RC_REW, BUTTON_NONE },
437 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_REW|BUTTON_REL, BUTTON_NONE },
438 { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
439 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_FF|BUTTON_REL, BUTTON_NONE },
440 { ACTION_PS_RESET, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
441 { ACTION_PS_TOGGLE_MODE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
442 { ACTION_PS_EXIT, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
443 { ACTION_PS_SLOWER, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
444 { ACTION_PS_FASTER, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
446 LAST_ITEM_IN_LIST
447 }; /* remote_button_context_pitchscreen */
449 static const struct button_mapping remote_button_context_right_is_inc[] = {
450 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
451 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
452 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
453 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
454 { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
455 { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
456 { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
457 { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
458 { ACTION_STD_OK, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
459 { ACTION_STD_CANCEL, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
461 LAST_ITEM_IN_LIST
462 }; /* remote_button_context_right_is_inc */
464 #ifdef USB_ENABLE_HID
465 static const struct button_mapping button_context_usb_hid[] = {
466 { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER },
467 { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER },
469 LAST_ITEM_IN_LIST
470 }; /* button_context_usb_hid */
472 static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
473 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
474 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
475 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE },
476 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
477 { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
478 { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
479 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
480 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_UP|BUTTON_REL, BUTTON_UP },
481 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
482 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
483 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
484 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
485 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
486 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
488 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
489 }; /* button_context_usb_hid_mode_multimedia */
491 static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
492 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
493 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_UP|BUTTON_REL, BUTTON_UP },
494 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
495 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
496 { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
497 { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
498 { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
499 { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
500 { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
501 { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV },
502 { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
503 { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT },
504 { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
505 { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
506 { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP, BUTTON_NONE },
507 { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
508 { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN, BUTTON_NONE },
509 { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
510 { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
511 { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_BACK|BUTTON_REL, BUTTON_BACK },
512 { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
513 { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK },
515 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
516 }; /* button_context_usb_hid_mode_presentation */
518 static const struct button_mapping button_context_usb_hid_mode_browser[] = {
519 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
520 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
521 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_PREV, BUTTON_NONE },
522 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
523 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
524 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
525 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_NEXT, BUTTON_NONE },
526 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
527 { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_UP|BUTTON_REL, BUTTON_UP },
528 { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_DOWN },
529 { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP },
530 { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN },
531 { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
532 { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_UP|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_UP|BUTTON_DOWN },
533 { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
534 { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
535 { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
536 { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_BACK|BUTTON_REPEAT, BUTTON_BACK },
537 { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
538 { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
539 { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
541 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
542 }; /* button_context_usb_hid_mode_browser */
544 #ifdef HAVE_USB_HID_MOUSE
545 static const struct button_mapping button_context_usb_hid_mode_mouse[] = {
546 { ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
547 { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
548 { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE },
549 { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
550 { ACTION_USB_HID_MOUSE_LEFT, BUTTON_LEFT, BUTTON_NONE },
551 { ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
552 { ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
553 { ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
554 { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE },
555 { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
556 { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE },
557 { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
558 { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE },
559 { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
560 { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE },
561 { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
562 { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE },
563 { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
564 { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_BACK, BUTTON_NONE },
565 { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_BACK|BUTTON_REL, BUTTON_NONE },
566 { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_BACK|BUTTON_UP, BUTTON_NONE },
567 { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_BACK|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
568 { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_BACK|BUTTON_DOWN, BUTTON_NONE },
569 { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_BACK|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
570 { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_BACK|BUTTON_LEFT, BUTTON_NONE },
571 { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_BACK|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
572 { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_BACK|BUTTON_RIGHT, BUTTON_NONE },
573 { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_BACK|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
574 { ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_MENU, BUTTON_NONE },
575 { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
576 { ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_MENU|BUTTON_UP, BUTTON_NONE },
577 { ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_MENU|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
578 { ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_MENU|BUTTON_DOWN, BUTTON_NONE },
579 { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_MENU|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
580 { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_MENU|BUTTON_LEFT, BUTTON_NONE },
581 { ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_MENU|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
582 { ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_MENU|BUTTON_RIGHT, BUTTON_NONE },
583 { ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_MENU|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
584 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
585 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
586 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_PREV, BUTTON_NONE },
587 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
588 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
589 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
590 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_NEXT, BUTTON_NONE },
591 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
593 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
594 }; /* button_context_usb_hid_mode_mouse */
595 #endif
597 static const struct button_mapping remote_button_context_usb_hid[] = {
598 { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_RC_DSP|BUTTON_REL, BUTTON_RC_DSP },
599 { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_RC_DSP|BUTTON_REPEAT, BUTTON_RC_DSP },
601 LAST_ITEM_IN_LIST
602 }; /* remote_button_context_usb_hid */
604 static const struct button_mapping remote_button_context_usb_hid_mode_multimedia[] = {
605 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
606 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
607 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
608 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
609 { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
610 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
611 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
612 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
613 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
615 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
616 }; /* remote_button_context_usb_hid_mode_multimedia */
618 static const struct button_mapping remote_button_context_usb_hid_mode_presentation[] = {
619 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
620 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
621 { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
622 { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
623 { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
624 { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
625 { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
626 { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
627 { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
628 { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
630 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
631 }; /* remote_button_context_usb_hid_mode_presentation */
633 static const struct button_mapping remote_button_context_usb_hid_mode_browser[] = {
634 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
635 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
636 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
637 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
638 { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF },
639 { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
640 { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_RC_FF|BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_FF|BUTTON_RC_REW },
641 { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
642 { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
643 { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
644 { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
646 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
647 }; /* remote_button_context_usb_hid_mode_browser */
648 #endif
650 static const struct button_mapping* get_context_mapping_remote( int context )
652 context &= ~CONTEXT_REMOTE;
654 switch (context)
656 case CONTEXT_WPS:
657 return remote_button_context_wps;
659 case CONTEXT_MAINMENU:
660 case CONTEXT_TREE:
661 return remote_button_context_tree;
663 case CONTEXT_SETTINGS_COLOURCHOOSER:
664 case CONTEXT_SETTINGS_EQ:
665 case CONTEXT_SETTINGS_RECTRIGGER:
666 return remote_button_context_right_is_inc;
668 case CONTEXT_SETTINGS_TIME:
669 return remote_button_context_time;
671 case CONTEXT_YESNOSCREEN:
672 return remote_button_context_yesno;
674 case CONTEXT_BOOKMARKSCREEN:
675 return remote_button_context_bmark;
677 case CONTEXT_QUICKSCREEN:
678 return remote_button_context_quickscreen;
680 case CONTEXT_PITCHSCREEN:
681 return remote_button_context_pitchscreen;
683 case CONTEXT_RECSCREEN:
684 return remote_button_context_recscreen;
686 case CONTEXT_KEYBOARD:
687 case CONTEXT_MORSE_INPUT:
688 return ACTION_NONE; /* Any sensible mapping for this remote? */
690 case CONTEXT_FM:
691 return remote_button_context_radio;
693 #ifdef USB_ENABLE_HID
694 case CONTEXT_USB_HID:
695 return remote_button_context_usb_hid;
696 case CONTEXT_USB_HID_MODE_MULTIMEDIA:
697 return remote_button_context_usb_hid_mode_multimedia;
698 case CONTEXT_USB_HID_MODE_PRESENTATION:
699 return remote_button_context_usb_hid_mode_presentation;
700 case CONTEXT_USB_HID_MODE_BROWSER:
701 return remote_button_context_usb_hid_mode_browser;
702 #endif
704 default:
705 return remote_button_context_standard;
709 const struct button_mapping* get_context_mapping(int context)
711 if (context & CONTEXT_REMOTE)
712 return get_context_mapping_remote(context);
714 switch (context)
716 case CONTEXT_WPS:
717 return button_context_wps;
719 case CONTEXT_LIST:
720 return button_context_list;
722 case CONTEXT_MAINMENU:
723 case CONTEXT_TREE:
724 if (global_settings.hold_lr_for_scroll_in_list)
725 return button_context_listtree_scroll_without_combo;
726 else
727 return button_context_listtree_scroll_with_combo;
729 case CONTEXT_CUSTOM|CONTEXT_TREE:
730 return button_context_tree;
732 case CONTEXT_SETTINGS:
733 return button_context_settings;
735 case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
736 return button_context_settings_right_is_inc;
738 case CONTEXT_SETTINGS_COLOURCHOOSER:
739 return button_context_colorchooser;
741 case CONTEXT_SETTINGS_EQ:
742 return button_context_eq;
744 case CONTEXT_SETTINGS_TIME:
745 return button_context_time;
747 case CONTEXT_YESNOSCREEN:
748 return button_context_yesno;
750 case CONTEXT_BOOKMARKSCREEN:
751 return button_context_bmark;
753 case CONTEXT_QUICKSCREEN:
754 return button_context_quickscreen;
756 case CONTEXT_PITCHSCREEN:
757 return button_context_pitchscreen;
759 case CONTEXT_RECSCREEN:
760 return button_context_recscreen;
762 case CONTEXT_SETTINGS_RECTRIGGER:
763 return button_context_settings_right_is_inc;
765 case CONTEXT_KEYBOARD:
766 case CONTEXT_MORSE_INPUT:
767 return button_context_keyboard;
769 case CONTEXT_FM:
770 return button_context_radio;
772 #ifdef USB_ENABLE_HID
773 case CONTEXT_USB_HID:
774 return button_context_usb_hid;
775 case CONTEXT_USB_HID_MODE_MULTIMEDIA:
776 return button_context_usb_hid_mode_multimedia;
777 case CONTEXT_USB_HID_MODE_PRESENTATION:
778 return button_context_usb_hid_mode_presentation;
779 case CONTEXT_USB_HID_MODE_BROWSER:
780 return button_context_usb_hid_mode_browser;
781 #ifdef HAVE_USB_HID_MOUSE
782 case CONTEXT_USB_HID_MODE_MOUSE:
783 return button_context_usb_hid_mode_mouse;
784 #endif
785 #endif
787 default:
788 return button_context_standard;