Extension entries need an extra nul byte.
[maemo-rb.git] / apps / keymaps / keymap-m3.c
blob6192d7ff6b194cbde34e49617136a3d0173f8c41
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2008 Jens Arnold
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 /* *
23 * Button Code Definitions for iaudio M3 targets
26 #include "config.h"
27 #include "action.h"
28 #include "button.h"
29 #include "settings.h"
31 /* CONTEXT_CUSTOM's used in this file...
33 CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
38 /** Keep things alphabetized for easy reference but standard contexts can
39 ** be first and sub-alphebetized.
40 **/
42 /** Standard Button Contexts **/
43 static const struct button_mapping button_context_standard[] = {
44 { ACTION_STD_PREV, BUTTON_VOL_UP, BUTTON_NONE },
45 { ACTION_STD_PREVREPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
46 { ACTION_STD_NEXT, BUTTON_VOL_DOWN, BUTTON_NONE },
47 { ACTION_STD_NEXTREPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
49 { ACTION_STD_CONTEXT, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
50 { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
51 { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
52 { ACTION_STD_OK, BUTTON_PLAY, BUTTON_NONE },
53 { ACTION_STD_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC },
54 { ACTION_STD_QUICKSCREEN, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
56 LAST_ITEM_IN_LIST
57 }; /* button_context_standard */
59 static const struct button_mapping remote_button_context_standard[] = {
60 { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
61 { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
62 { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
63 { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
65 { ACTION_STD_CONTEXT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
66 { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE },
67 { ACTION_STD_OK, BUTTON_RC_FF, BUTTON_NONE },
68 { ACTION_STD_OK, BUTTON_RC_PLAY, BUTTON_NONE },
69 { ACTION_STD_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
70 { ACTION_STD_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
72 LAST_ITEM_IN_LIST
73 }; /* remote_button_context_standard */
75 /** Bookmark Screen **/
76 static const struct button_mapping button_context_bmark[] = {
77 { ACTION_BMS_DELETE, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
79 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
80 }; /* button_context_settings_bmark */
82 static const struct button_mapping remote_button_context_bmark[] = {
83 { ACTION_BMS_DELETE, BUTTON_RC_REC|BUTTON_REPEAT, BUTTON_RC_REC },
85 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
86 }; /* button_context_settings_bmark */
88 /** FM Radio Screen **/
89 static const struct button_mapping button_context_radio[] = {
90 { ACTION_FM_MENU, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
91 { ACTION_FM_PRESET, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
92 { ACTION_FM_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
93 { ACTION_FM_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
94 { ACTION_FM_MODE, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
95 { ACTION_FM_EXIT, BUTTON_REC|BUTTON_REL, BUTTON_REC },
96 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
97 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
98 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
100 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
101 }; /* button_context_radio */
103 static const struct button_mapping remote_button_context_radio[] = {
104 { ACTION_FM_MENU, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
105 { ACTION_FM_PRESET, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
106 { ACTION_FM_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
107 { ACTION_FM_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
108 { ACTION_FM_MODE, BUTTON_RC_REC|BUTTON_REPEAT, BUTTON_RC_REC },
109 { ACTION_FM_EXIT, BUTTON_RC_MENU, BUTTON_NONE },
110 { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
111 { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE },
112 { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
114 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
115 }; /* remote_button_context_radio */
117 /** Keyboard **/
118 static const struct button_mapping button_context_keyboard[] = {
119 { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
120 { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
121 { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
122 { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
123 { ACTION_KBD_UP, BUTTON_VOL_UP, BUTTON_NONE },
124 { ACTION_KBD_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
125 { ACTION_KBD_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
126 { ACTION_KBD_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
127 { ACTION_KBD_PAGE_FLIP, BUTTON_MODE, BUTTON_NONE },
128 { ACTION_KBD_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
129 { ACTION_KBD_DONE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
130 { ACTION_KBD_ABORT, BUTTON_REC, BUTTON_NONE },
132 LAST_ITEM_IN_LIST
133 }; /* button_context_keyboard */
135 static const struct button_mapping remote_button_context_keyboard[] = {
136 { ACTION_KBD_LEFT, BUTTON_RC_REW, BUTTON_NONE },
137 { ACTION_KBD_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
138 { ACTION_KBD_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
139 { ACTION_KBD_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
140 { ACTION_KBD_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
141 { ACTION_KBD_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
142 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
143 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
144 { ACTION_KBD_PAGE_FLIP, BUTTON_RC_MODE, BUTTON_NONE },
145 { ACTION_KBD_SELECT, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
146 { ACTION_KBD_DONE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
147 { ACTION_KBD_ABORT, BUTTON_RC_REC, BUTTON_NONE },
149 LAST_ITEM_IN_LIST
150 }; /* remote_button_context_keyboard */
152 /** Pitchscreen **/
153 static const struct button_mapping button_context_pitchscreen[] = {
154 { ACTION_PS_INC_SMALL, BUTTON_VOL_UP, BUTTON_NONE },
155 { ACTION_PS_INC_BIG, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
156 { ACTION_PS_DEC_SMALL, BUTTON_VOL_DOWN, BUTTON_NONE },
157 { ACTION_PS_DEC_BIG, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
158 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
159 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
160 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
161 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
162 { ACTION_PS_TOGGLE_MODE, BUTTON_MODE, BUTTON_NONE },
163 { ACTION_PS_RESET, BUTTON_REC, BUTTON_NONE },
164 { ACTION_PS_EXIT, BUTTON_PLAY, BUTTON_NONE },
165 { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
166 { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
168 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
169 }; /* button_context_pitchscreen */
171 static const struct button_mapping remote_button_context_pitchscreen[] = {
172 { ACTION_PS_INC_SMALL, BUTTON_RC_VOL_UP, BUTTON_NONE },
173 { ACTION_PS_INC_BIG, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
174 { ACTION_PS_DEC_SMALL, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
175 { ACTION_PS_DEC_BIG, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
176 { ACTION_PS_NUDGE_LEFT, BUTTON_RC_REW, BUTTON_NONE },
177 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_REW|BUTTON_REL, BUTTON_NONE },
178 { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
179 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_FF|BUTTON_REL, BUTTON_NONE },
180 { ACTION_PS_TOGGLE_MODE, BUTTON_RC_MODE, BUTTON_NONE },
181 { ACTION_PS_RESET, BUTTON_RC_REC, BUTTON_NONE },
182 { ACTION_PS_EXIT, BUTTON_RC_PLAY, BUTTON_NONE },
183 { ACTION_PS_SLOWER, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
184 { ACTION_PS_FASTER, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
186 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
187 }; /* remote_button_context_pitchscreen */
189 /** Quickscreen **/
190 static const struct button_mapping button_context_quickscreen[] = {
191 { ACTION_QS_TOP, BUTTON_VOL_UP, BUTTON_NONE },
192 { ACTION_QS_TOP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
193 { ACTION_QS_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
194 { ACTION_QS_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
195 { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
196 { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
197 { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
198 { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
199 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
201 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
202 }; /* button_context_quickscreen */
204 static const struct button_mapping remote_button_context_quickscreen[] = {
205 { ACTION_QS_TOP, BUTTON_RC_VOL_UP, BUTTON_NONE },
206 { ACTION_QS_TOP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
207 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
208 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
209 { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE },
210 { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
211 { ACTION_QS_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
212 { ACTION_QS_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
213 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
215 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
216 }; /* remote_button_context_quickscreen */
218 /** Recording Screen **/
219 static const struct button_mapping button_context_recscreen[] = {
220 { ACTION_REC_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
221 { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
222 { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
223 { ACTION_STD_MENU, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
224 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
225 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
226 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
227 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
229 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
230 }; /* button_context_recscreen */
232 static const struct button_mapping remote_button_context_recscreen[] = {
233 { ACTION_REC_PAUSE, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
234 { ACTION_STD_CANCEL, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
235 { ACTION_REC_NEWFILE, BUTTON_RC_REC, BUTTON_NONE },
236 { ACTION_STD_MENU, BUTTON_RC_MENU, BUTTON_NONE },
237 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
238 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
239 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
240 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
242 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
243 }; /* remote_button_context_recscreen */
245 /** Settings - General Mappings **/
246 static const struct button_mapping button_context_settings[] = {
247 { ACTION_SETTINGS_INC, BUTTON_VOL_UP, BUTTON_NONE },
248 { ACTION_SETTINGS_INCREPEAT, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
249 { ACTION_SETTINGS_DEC, BUTTON_VOL_DOWN, BUTTON_NONE },
250 { ACTION_SETTINGS_DECREPEAT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
251 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
252 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
254 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
255 }; /* button_context_settings */
257 static const struct button_mapping remote_button_context_settings[] = {
258 { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
259 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
260 { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
261 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
262 { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE },
263 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
265 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
266 }; /* remote_button_context_settings */
268 /** Settings - Using Sliders **/
269 static const struct button_mapping button_context_settings_r_is_inc[] = {
270 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
271 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
272 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
273 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
274 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
276 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
277 }; /* button_context_settings_r_is_inc */
279 static const struct button_mapping remote_button_context_settings_r_is_inc[] = {
280 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
281 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
282 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
283 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT,BUTTON_NONE },
284 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
286 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
287 }; /* remote_button_context_settings_r_is_inc */
289 /** Tree **/
290 static const struct button_mapping button_context_tree[] = {
291 { ACTION_NONE, BUTTON_PLAY, BUTTON_NONE },
292 { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
293 { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
294 { ACTION_TREE_HOTKEY, BUTTON_REC|BUTTON_MODE, BUTTON_REC },
296 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
297 }; /* button_context_tree */
299 static const struct button_mapping remote_button_context_tree[] = {
300 { ACTION_NONE, BUTTON_RC_PLAY, BUTTON_NONE },
301 { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
302 { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
304 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
305 }; /* remote_button_context_tree */
307 static const struct button_mapping button_context_tree_scroll_lr[] = {
308 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
309 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
310 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
311 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
312 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
313 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
314 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
316 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
317 }; /* button_context_tree_scroll_lr */
319 static const struct button_mapping remote_button_context_tree_scroll_lr[] = {
320 { ACTION_NONE, BUTTON_RC_REW, BUTTON_NONE },
321 { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
322 { ACTION_TREE_ROOT_INIT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
323 { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
324 { ACTION_NONE, BUTTON_RC_FF, BUTTON_NONE },
325 { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
326 { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
328 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
329 }; /* remote_button_context_tree_scroll_lr */
331 /** While-Playing Screen (WPS) **/
332 static const struct button_mapping button_context_wps[] = {
333 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
334 { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
335 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
336 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
337 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
338 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
339 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
340 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
342 { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
343 { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
344 { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
345 { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
347 { ACTION_WPS_BROWSE, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
348 { ACTION_WPS_CONTEXT, BUTTON_MODE|BUTTON_REPEAT, BUTTON_MODE },
349 { ACTION_WPS_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC },
350 { ACTION_WPS_QUICKSCREEN, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
351 { ACTION_WPS_HOTKEY, BUTTON_REC|BUTTON_MODE, BUTTON_REC },
353 LAST_ITEM_IN_LIST
354 }; /* button_context_wps */
356 static const struct button_mapping remote_button_context_wps[] = {
357 { ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
358 { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
359 { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
360 { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
361 { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
362 { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
363 { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
364 { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
366 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
367 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
368 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
369 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
371 { ACTION_WPS_BROWSE, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
372 { ACTION_WPS_CONTEXT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
373 { ACTION_WPS_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
374 { ACTION_WPS_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
376 LAST_ITEM_IN_LIST
377 }; /* remote_button_context_wps */
379 /** Yes/No Screen **/
380 static const struct button_mapping button_context_yesnoscreen[] = {
381 { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE },
382 LAST_ITEM_IN_LIST
383 }; /* button_context_yesnoscreen */
385 static const struct button_mapping remote_button_context_yesnoscreen[] = {
386 { ACTION_YESNO_ACCEPT, BUTTON_RC_PLAY, BUTTON_NONE },
387 LAST_ITEM_IN_LIST
388 }; /* remote_button_context_yesnoscreen */
391 static const struct button_mapping* get_context_mapping_remote( int context )
393 context ^= CONTEXT_REMOTE;
395 switch (context)
397 /* anything that uses remote_button_context_standard */
398 default:
399 return remote_button_context_standard;
401 /* remote contexts with special mapping */
402 case CONTEXT_BOOKMARKSCREEN:
403 return remote_button_context_bmark;
405 case CONTEXT_FM:
406 return remote_button_context_radio;
408 case CONTEXT_KEYBOARD:
409 return remote_button_context_keyboard;
411 case CONTEXT_PITCHSCREEN:
412 return remote_button_context_pitchscreen;
414 case CONTEXT_QUICKSCREEN:
415 return remote_button_context_quickscreen;
417 case CONTEXT_RECSCREEN:
418 return remote_button_context_recscreen;
420 case CONTEXT_SETTINGS:
421 return remote_button_context_settings;
423 case CONTEXT_SETTINGS_EQ:
424 case CONTEXT_SETTINGS_TIME:
425 return remote_button_context_settings_r_is_inc;
427 case CONTEXT_TREE:
428 case CONTEXT_MAINMENU:
429 if (global_settings.hold_lr_for_scroll_in_list)
430 return remote_button_context_tree_scroll_lr;
431 /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */
432 case CONTEXT_TREE|CONTEXT_CUSTOM:
433 return remote_button_context_tree;
435 case CONTEXT_WPS:
436 return remote_button_context_wps;
438 case CONTEXT_YESNOSCREEN:
439 return remote_button_context_yesnoscreen;
443 const struct button_mapping* get_context_mapping(int context)
445 if (context & CONTEXT_REMOTE)
446 return get_context_mapping_remote(context);
448 switch (context)
450 /* anything that uses button_context_standard */
451 default:
452 return button_context_standard;
454 /* contexts with special mapping */
455 case CONTEXT_BOOKMARKSCREEN:
456 return button_context_bmark;
458 case CONTEXT_FM:
459 return button_context_radio;
461 case CONTEXT_KEYBOARD:
462 return button_context_keyboard;
464 case CONTEXT_PITCHSCREEN:
465 return button_context_pitchscreen;
467 case CONTEXT_QUICKSCREEN:
468 return button_context_quickscreen;
470 case CONTEXT_RECSCREEN:
471 return button_context_recscreen;
473 case CONTEXT_SETTINGS:
474 return button_context_settings;
476 case CONTEXT_SETTINGS_EQ:
477 case CONTEXT_SETTINGS_RECTRIGGER:
478 return button_context_settings_r_is_inc;
480 case CONTEXT_TREE:
481 case CONTEXT_MAINMENU:
482 if (global_settings.hold_lr_for_scroll_in_list)
483 return button_context_tree_scroll_lr;
484 /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */
485 case CONTEXT_TREE|CONTEXT_CUSTOM:
486 return button_context_tree;
488 case CONTEXT_WPS:
489 return button_context_wps;
491 case CONTEXT_YESNOSCREEN:
492 return button_context_yesnoscreen;