Add coloured rows to the other tables in the manual (button maps already done).
[maemo-rb.git] / apps / keymaps / keymap-x5.c
blob7a7dd9a7c9ca6665b637ce8364aa418bfd3aeb71
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 /* *
23 * Button Code Definitions for iaudio m5/x5 targets
25 * Note that button combos are incompatible on this targets, except for those
26 * with the power button. But these are discouraged because the the power button
27 * also does the hardware poweroff
29 * \TODO test!
32 #include "config.h"
33 #include "action.h"
34 #include "button.h"
35 #include "settings.h"
37 /* CONTEXT_CUSTOM's used in this file...
39 CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
44 /** Keep things alphabetized for easy reference but standard contexts can
45 ** be first and sub-alphebetized.
46 **/
48 /** Standard Button Contexts **/
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_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
56 { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
57 { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
58 { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
59 { ACTION_STD_OK, BUTTON_PLAY, BUTTON_NONE },
60 { ACTION_STD_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC },
61 { ACTION_STD_QUICKSCREEN,BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
62 { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE },
64 LAST_ITEM_IN_LIST
65 }; /* button_context_standard */
67 static const struct button_mapping remote_button_context_standard[] = {
68 { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE },
69 { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
70 { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
71 { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
73 { ACTION_STD_CONTEXT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
74 { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE },
75 { ACTION_STD_OK, BUTTON_RC_FF, BUTTON_NONE },
76 { ACTION_STD_OK, BUTTON_RC_PLAY, BUTTON_NONE },
77 { ACTION_STD_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
78 { ACTION_STD_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
80 LAST_ITEM_IN_LIST
81 }; /* remote_button_context_standard */
83 /** Bookmark Screen **/
84 static const struct button_mapping button_context_bmark[] = {
85 { ACTION_BMS_DELETE, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
87 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
88 }; /* button_context_settings_bmark */
90 static const struct button_mapping remote_button_context_bmark[] = {
91 { ACTION_BMS_DELETE, BUTTON_RC_REC|BUTTON_REPEAT, BUTTON_RC_REC },
93 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
94 }; /* button_context_settings_bmark */
96 /** FM Radio Screen **/
97 static const struct button_mapping button_context_radio[] = {
98 { ACTION_FM_MENU, BUTTON_SELECT | BUTTON_REPEAT, BUTTON_NONE },
99 { ACTION_FM_PRESET, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT },
100 { ACTION_FM_STOP, BUTTON_POWER, BUTTON_NONE },
101 { ACTION_FM_MODE, BUTTON_PLAY | BUTTON_REPEAT, BUTTON_PLAY },
102 { ACTION_FM_EXIT, BUTTON_REC | BUTTON_REL, BUTTON_REC },
103 { ACTION_FM_PLAY, BUTTON_PLAY | BUTTON_REL, BUTTON_PLAY },
104 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
105 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
106 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
108 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
109 }; /* button_context_radio */
111 static const struct button_mapping remote_button_context_radio[] = {
112 { ACTION_FM_MENU, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
113 { ACTION_FM_PRESET, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
114 { ACTION_FM_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
115 { ACTION_FM_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
116 { ACTION_FM_MODE, BUTTON_RC_REC|BUTTON_REPEAT, BUTTON_RC_REC },
117 { ACTION_FM_EXIT, BUTTON_RC_MENU, BUTTON_NONE },
118 { ACTION_STD_PREVREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
119 { ACTION_STD_NEXT, BUTTON_RC_FF, BUTTON_NONE },
120 { ACTION_STD_NEXTREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
122 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
123 }; /* remote_button_context_radio */
125 /** Keyboard **/
126 static const struct button_mapping button_context_keyboard[] = {
127 { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
128 { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
129 { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
130 { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
131 { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
132 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
133 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
134 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
135 { ACTION_KBD_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
136 { ACTION_KBD_DONE, BUTTON_PLAY, BUTTON_NONE },
137 { ACTION_KBD_ABORT, BUTTON_REC, BUTTON_NONE },
139 LAST_ITEM_IN_LIST
140 }; /* button_context_keyboard */
142 static const struct button_mapping remote_button_context_keyboard[] = {
143 { ACTION_KBD_LEFT, BUTTON_RC_REW, BUTTON_NONE },
144 { ACTION_KBD_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
145 { ACTION_KBD_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
146 { ACTION_KBD_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
147 { ACTION_KBD_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
148 { ACTION_KBD_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
149 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
150 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
151 { ACTION_KBD_PAGE_FLIP, BUTTON_RC_MODE, BUTTON_NONE },
152 { ACTION_KBD_SELECT, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
153 { ACTION_KBD_DONE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
154 { ACTION_KBD_ABORT, BUTTON_RC_REC, BUTTON_NONE },
156 LAST_ITEM_IN_LIST
157 }; /* remote_button_context_keyboard */
159 /** Pitchscreen **/
160 static const struct button_mapping button_context_pitchscreen[] = {
161 { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
162 { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
163 { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
164 { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
165 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
166 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
167 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
168 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
169 { ACTION_PS_TOGGLE_MODE, BUTTON_SELECT, BUTTON_NONE },
170 { ACTION_PS_RESET, BUTTON_POWER, BUTTON_NONE },
171 { ACTION_PS_EXIT, BUTTON_PLAY, BUTTON_NONE },
172 { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
173 { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
175 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
176 }; /* button_context_pitchscreen */
178 static const struct button_mapping remote_button_context_pitchscreen[] = {
179 { ACTION_PS_INC_SMALL, BUTTON_RC_VOL_UP, BUTTON_NONE },
180 { ACTION_PS_INC_BIG, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
181 { ACTION_PS_DEC_SMALL, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
182 { ACTION_PS_DEC_BIG, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
183 { ACTION_PS_NUDGE_LEFT, BUTTON_RC_REW, BUTTON_NONE },
184 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_REW|BUTTON_REL, BUTTON_NONE },
185 { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
186 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_FF|BUTTON_REL, BUTTON_NONE },
187 { ACTION_PS_TOGGLE_MODE, BUTTON_RC_MODE, BUTTON_NONE },
188 { ACTION_PS_RESET, BUTTON_RC_REC, BUTTON_NONE },
189 { ACTION_PS_EXIT, BUTTON_RC_PLAY, BUTTON_NONE },
190 { ACTION_PS_SLOWER, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
191 { ACTION_PS_FASTER, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
193 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
194 }; /* remote_button_context_pitchscreen */
196 /** Quickscreen **/
197 static const struct button_mapping button_context_quickscreen[] = {
198 { ACTION_QS_DOWNINV, BUTTON_UP, BUTTON_NONE },
199 { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
200 { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
201 { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
202 { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
203 { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
204 { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
205 { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
206 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
208 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
209 }; /* button_context_quickscreen */
211 static const struct button_mapping remote_button_context_quickscreen[] = {
212 { ACTION_QS_DOWNINV, BUTTON_RC_VOL_UP, BUTTON_NONE },
213 { ACTION_QS_DOWNINV, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
214 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
215 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
216 { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE },
217 { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
218 { ACTION_QS_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
219 { ACTION_QS_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
220 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
222 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
223 }; /* remote_button_context_quickscreen */
225 /** Recording Screen **/
226 static const struct button_mapping button_context_recscreen[] = {
227 { ACTION_REC_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
228 { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
229 { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
230 { ACTION_STD_MENU, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
231 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
232 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
233 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
234 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
236 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
237 }; /* button_context_recscreen */
239 static const struct button_mapping remote_button_context_recscreen[] = {
240 { ACTION_REC_PAUSE, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
241 { ACTION_STD_CANCEL, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
242 { ACTION_REC_NEWFILE, BUTTON_RC_REC, BUTTON_NONE },
243 { ACTION_STD_MENU, BUTTON_RC_MENU, BUTTON_NONE },
244 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
245 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
246 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
247 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
249 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
250 }; /* remote_button_context_recscreen */
252 /** Settings - General Mappings **/
253 static const struct button_mapping button_context_settings[] = {
254 { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
255 { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
256 { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
257 { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
258 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
259 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
261 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
262 }; /* button_context_settings */
264 static const struct button_mapping remote_button_context_settings[] = {
265 { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
266 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
267 { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
268 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
269 { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE },
270 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
272 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
273 }; /* remote_button_context_settings */
275 /** Settings - Using Sliders **/
276 static const struct button_mapping button_context_settings_r_is_inc[] = {
277 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
278 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
279 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
280 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
281 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
282 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
283 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
284 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
285 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
287 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
288 }; /* button_context_settings_r_is_inc */
290 static const struct button_mapping remote_button_context_settings_r_is_inc[] = {
291 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
292 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
293 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
294 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT,BUTTON_NONE },
295 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
297 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
298 }; /* remote_button_context_settings_r_is_inc */
300 /** Settings - Time/Date **/
301 static const struct button_mapping button_context_settings_time[] = {
302 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
303 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
304 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
306 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
307 }; /* button_context_settings */
309 /** Tree **/
310 static const struct button_mapping button_context_tree[] = {
311 { ACTION_NONE, BUTTON_PLAY, BUTTON_NONE },
312 { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
313 { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
315 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
316 }; /* button_context_tree */
318 static const struct button_mapping remote_button_context_tree[] = {
319 { ACTION_NONE, BUTTON_RC_PLAY, BUTTON_NONE },
320 { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
321 { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
323 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
324 }; /* remote_button_context_tree */
326 static const struct button_mapping button_context_tree_scroll_lr[] = {
327 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
328 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
329 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
330 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
331 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
332 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
333 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
334 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
335 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
337 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
338 }; /* button_context_tree_scroll_lr */
340 static const struct button_mapping remote_button_context_tree_scroll_lr[] = {
341 { ACTION_NONE, BUTTON_RC_REW, BUTTON_NONE },
342 { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
343 { ACTION_TREE_ROOT_INIT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
344 { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
345 { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
346 { ACTION_NONE, BUTTON_RC_FF, BUTTON_NONE },
347 { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
348 { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
349 { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
351 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
352 }; /* remote_button_context_tree_scroll_lr */
354 /** While-Playing Screen (WPS) **/
355 static const struct button_mapping button_context_wps[] = {
356 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
357 { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
358 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
359 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
360 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
361 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
362 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
363 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
365 { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
366 { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
367 { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
368 { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
370 { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
371 { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
372 { ACTION_WPS_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC },
373 { ACTION_WPS_QUICKSCREEN, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
375 * Can't really do combos on M5
376 * { ACTION_WPS_VIEW_PLAYLIST, BUTTON_REC|BUTTON_SELECT, BUTTON_NONE },
379 LAST_ITEM_IN_LIST
380 }; /* button_context_wps */
382 static const struct button_mapping remote_button_context_wps[] = {
383 { ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
384 { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
385 { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
386 { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
387 { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
388 { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
389 { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
390 { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
392 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
393 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
394 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
395 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
397 { ACTION_WPS_BROWSE, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
398 { ACTION_WPS_CONTEXT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
399 { ACTION_WPS_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
400 { ACTION_WPS_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
402 LAST_ITEM_IN_LIST
403 }; /* remote_button_context_wps */
405 /** Yes/No Screen **/
406 static const struct button_mapping button_context_yesnoscreen[] = {
407 { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
408 LAST_ITEM_IN_LIST
409 }; /* button_context_settings_yesnoscreen */
411 static const struct button_mapping remote_button_context_yesnoscreen[] = {
412 { ACTION_YESNO_ACCEPT, BUTTON_RC_PLAY, BUTTON_NONE },
413 LAST_ITEM_IN_LIST
414 }; /* remote_button_context_settings_yesnoscreen */
417 static const struct button_mapping* get_context_mapping_remote( int context )
419 context ^= CONTEXT_REMOTE;
421 switch (context)
423 /* anything that uses remote_button_context_standard */
424 default:
425 return remote_button_context_standard;
427 /* remote contexts with special mapping */
428 case CONTEXT_BOOKMARKSCREEN:
429 return remote_button_context_bmark;
431 case CONTEXT_FM:
432 return remote_button_context_radio;
434 case CONTEXT_KEYBOARD:
435 return remote_button_context_keyboard;
437 case CONTEXT_PITCHSCREEN:
438 return remote_button_context_pitchscreen;
440 case CONTEXT_QUICKSCREEN:
441 return remote_button_context_quickscreen;
443 case CONTEXT_RECSCREEN:
444 return remote_button_context_recscreen;
446 case CONTEXT_SETTINGS:
447 return remote_button_context_settings;
449 case CONTEXT_SETTINGS_COLOURCHOOSER:
450 case CONTEXT_SETTINGS_EQ:
451 case CONTEXT_SETTINGS_TIME:
452 return remote_button_context_settings_r_is_inc;
454 case CONTEXT_TREE:
455 case CONTEXT_MAINMENU:
456 if (global_settings.hold_lr_for_scroll_in_list)
457 return remote_button_context_tree_scroll_lr;
458 /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */
459 case CONTEXT_TREE|CONTEXT_CUSTOM:
460 return remote_button_context_tree;
462 case CONTEXT_WPS:
463 return remote_button_context_wps;
465 case CONTEXT_YESNOSCREEN:
466 return remote_button_context_yesnoscreen;
470 const struct button_mapping* get_context_mapping( int context )
472 if (context & CONTEXT_REMOTE)
473 return get_context_mapping_remote(context);
475 switch( context )
477 /* anything that uses button_context_standard */
478 case CONTEXT_LIST:
479 case CONTEXT_STD:
480 default:
481 return button_context_standard;
483 /* contexts with special mapping */
484 case CONTEXT_BOOKMARKSCREEN:
485 return button_context_bmark;
487 case CONTEXT_FM:
488 return button_context_radio;
490 case CONTEXT_KEYBOARD:
491 return button_context_keyboard;
494 case CONTEXT_PITCHSCREEN:
495 return button_context_pitchscreen;
497 case CONTEXT_QUICKSCREEN:
498 return button_context_quickscreen;
500 case CONTEXT_RECSCREEN:
501 return button_context_recscreen;
503 case CONTEXT_SETTINGS:
504 return button_context_settings;
506 case CONTEXT_SETTINGS_COLOURCHOOSER:
507 case CONTEXT_SETTINGS_EQ:
508 case CONTEXT_SETTINGS_RECTRIGGER:
509 return button_context_settings_r_is_inc;
511 case CONTEXT_SETTINGS_TIME:
512 return button_context_settings_time;
514 case CONTEXT_TREE:
515 case CONTEXT_MAINMENU:
516 if (global_settings.hold_lr_for_scroll_in_list)
517 return button_context_tree_scroll_lr;
518 /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */
519 case CONTEXT_TREE|CONTEXT_CUSTOM:
520 return button_context_tree;
522 case CONTEXT_WPS:
523 return button_context_wps;
525 case CONTEXT_YESNOSCREEN:
526 return button_context_yesnoscreen;