Onle one table row per WPS tag
[maemo-rb.git] / apps / keymaps / keymap-x5.c
blob45356b5775ec37a3652bee071ae4bee59f387e8d
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_REL, BUTTON_RC_MENU },
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_NONE },
136 { ACTION_KBD_DONE, BUTTON_PLAY, BUTTON_NONE },
137 { ACTION_KBD_ABORT, BUTTON_REC, BUTTON_NONE },
138 { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE },
140 LAST_ITEM_IN_LIST
141 }; /* button_context_keyboard */
143 static const struct button_mapping remote_button_context_keyboard[] = {
144 { ACTION_KBD_LEFT, BUTTON_RC_REW, BUTTON_NONE },
145 { ACTION_KBD_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
146 { ACTION_KBD_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
147 { ACTION_KBD_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
148 { ACTION_KBD_UP, BUTTON_RC_VOL_UP, BUTTON_NONE },
149 { ACTION_KBD_UP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
150 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
151 { ACTION_KBD_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
152 { ACTION_KBD_PAGE_FLIP, BUTTON_RC_MODE, BUTTON_NONE },
153 { ACTION_KBD_SELECT, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
154 { ACTION_KBD_DONE, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
155 { ACTION_KBD_ABORT, BUTTON_RC_REC, BUTTON_NONE },
157 LAST_ITEM_IN_LIST
158 }; /* remote_button_context_keyboard */
160 /** Pitchscreen **/
161 static const struct button_mapping button_context_pitchscreen[] = {
162 { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
163 { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
164 { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
165 { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
166 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
167 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
168 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
169 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
170 { ACTION_PS_TOGGLE_MODE, BUTTON_SELECT, BUTTON_NONE },
171 { ACTION_PS_RESET, BUTTON_POWER, BUTTON_NONE },
172 { ACTION_PS_EXIT, BUTTON_PLAY, BUTTON_NONE },
173 { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
174 { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
176 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
177 }; /* button_context_pitchscreen */
179 static const struct button_mapping remote_button_context_pitchscreen[] = {
180 { ACTION_PS_INC_SMALL, BUTTON_RC_VOL_UP, BUTTON_NONE },
181 { ACTION_PS_INC_BIG, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
182 { ACTION_PS_DEC_SMALL, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
183 { ACTION_PS_DEC_BIG, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
184 { ACTION_PS_NUDGE_LEFT, BUTTON_RC_REW, BUTTON_NONE },
185 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_RC_REW|BUTTON_REL, BUTTON_NONE },
186 { ACTION_PS_NUDGE_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
187 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RC_FF|BUTTON_REL, BUTTON_NONE },
188 { ACTION_PS_TOGGLE_MODE, BUTTON_RC_MODE, BUTTON_NONE },
189 { ACTION_PS_RESET, BUTTON_RC_REC, BUTTON_NONE },
190 { ACTION_PS_EXIT, BUTTON_RC_PLAY, BUTTON_NONE },
191 { ACTION_PS_SLOWER, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
192 { ACTION_PS_FASTER, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
194 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
195 }; /* remote_button_context_pitchscreen */
197 /** Quickscreen **/
198 static const struct button_mapping button_context_quickscreen[] = {
199 { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE },
200 { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
201 { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
202 { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
203 { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
204 { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
205 { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
206 { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
207 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
209 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
210 }; /* button_context_quickscreen */
212 static const struct button_mapping remote_button_context_quickscreen[] = {
213 { ACTION_QS_TOP, BUTTON_RC_VOL_UP, BUTTON_NONE },
214 { ACTION_QS_TOP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
215 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
216 { ACTION_QS_DOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
217 { ACTION_QS_LEFT, BUTTON_RC_REW, BUTTON_NONE },
218 { ACTION_QS_LEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
219 { ACTION_QS_RIGHT, BUTTON_RC_FF, BUTTON_NONE },
220 { ACTION_QS_RIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
221 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
223 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
224 }; /* remote_button_context_quickscreen */
226 /** Recording Screen **/
227 static const struct button_mapping button_context_recscreen[] = {
228 { ACTION_REC_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
229 { ACTION_STD_CANCEL, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
230 { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
231 { ACTION_STD_MENU, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
232 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
233 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
234 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
235 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
237 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
238 }; /* button_context_recscreen */
240 static const struct button_mapping remote_button_context_recscreen[] = {
241 { ACTION_REC_PAUSE, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
242 { ACTION_STD_CANCEL, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
243 { ACTION_REC_NEWFILE, BUTTON_RC_REC, BUTTON_NONE },
244 { ACTION_STD_MENU, BUTTON_RC_MENU, BUTTON_NONE },
245 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
246 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
247 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
248 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
250 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
251 }; /* remote_button_context_recscreen */
253 /** Settings - General Mappings **/
254 static const struct button_mapping button_context_settings[] = {
255 { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
256 { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
257 { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
258 { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
259 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
260 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
262 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
263 }; /* button_context_settings */
265 static const struct button_mapping remote_button_context_settings[] = {
266 { ACTION_SETTINGS_INC, BUTTON_RC_VOL_UP, BUTTON_NONE },
267 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
268 { ACTION_SETTINGS_DEC, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
269 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
270 { ACTION_STD_PREV, BUTTON_RC_REW, BUTTON_NONE },
271 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
273 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
274 }; /* remote_button_context_settings */
276 /** Settings - Using Sliders **/
277 static const struct button_mapping button_context_settings_r_is_inc[] = {
278 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
279 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
280 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
281 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
282 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
283 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
284 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
285 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
286 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
288 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
289 }; /* button_context_settings_r_is_inc */
291 static const struct button_mapping remote_button_context_settings_r_is_inc[] = {
292 { ACTION_SETTINGS_INC, BUTTON_RC_FF, BUTTON_NONE },
293 { ACTION_SETTINGS_INCREPEAT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
294 { ACTION_SETTINGS_DEC, BUTTON_RC_REW, BUTTON_NONE },
295 { ACTION_SETTINGS_DECREPEAT, BUTTON_RC_REW|BUTTON_REPEAT,BUTTON_NONE },
296 { ACTION_STD_CANCEL, BUTTON_RC_REC, BUTTON_NONE },
298 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
299 }; /* remote_button_context_settings_r_is_inc */
301 /** Settings - Time/Date **/
302 static const struct button_mapping button_context_settings_time[] = {
303 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
304 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
305 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
307 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
308 }; /* button_context_settings */
310 /** Tree **/
311 static const struct button_mapping button_context_tree[] = {
312 { ACTION_NONE, BUTTON_PLAY, BUTTON_NONE },
313 { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
314 { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
316 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
317 }; /* button_context_tree */
319 static const struct button_mapping remote_button_context_tree[] = {
320 { ACTION_NONE, BUTTON_RC_PLAY, BUTTON_NONE },
321 { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
322 { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
324 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
325 }; /* remote_button_context_tree */
327 static const struct button_mapping button_context_tree_scroll_lr[] = {
328 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
329 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
330 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
331 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
332 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
333 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
334 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
335 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
336 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
338 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
339 }; /* button_context_tree_scroll_lr */
341 static const struct button_mapping remote_button_context_tree_scroll_lr[] = {
342 { ACTION_NONE, BUTTON_RC_REW, BUTTON_NONE },
343 { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
344 { ACTION_TREE_ROOT_INIT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_RC_REW },
345 { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
346 { ACTION_TREE_PGLEFT, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
347 { ACTION_NONE, BUTTON_RC_FF, BUTTON_NONE },
348 { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
349 { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
350 { ACTION_TREE_PGRIGHT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
352 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
353 }; /* remote_button_context_tree_scroll_lr */
355 /** While-Playing Screen (WPS) **/
356 static const struct button_mapping button_context_wps[] = {
357 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
358 { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
359 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
360 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
361 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
362 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
363 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
364 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
366 { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
367 { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
368 { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
369 { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
371 { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
372 { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
373 { ACTION_WPS_MENU, BUTTON_REC|BUTTON_REL, BUTTON_REC },
374 { ACTION_WPS_QUICKSCREEN, BUTTON_REC|BUTTON_REPEAT, BUTTON_REC },
376 * Can't really do combos on M5
377 * { ACTION_WPS_VIEW_PLAYLIST, BUTTON_REC|BUTTON_SELECT, BUTTON_NONE },
380 LAST_ITEM_IN_LIST
381 }; /* button_context_wps */
383 static const struct button_mapping remote_button_context_wps[] = {
384 { ACTION_WPS_PLAY, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY },
385 { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY },
386 { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW },
387 { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE },
388 { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT },
389 { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF },
390 { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE },
391 { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT },
393 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
394 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
395 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
396 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
398 { ACTION_WPS_BROWSE, BUTTON_RC_MODE|BUTTON_REL, BUTTON_RC_MODE },
399 { ACTION_WPS_CONTEXT, BUTTON_RC_MODE|BUTTON_REPEAT, BUTTON_RC_MODE },
400 { ACTION_WPS_MENU, BUTTON_RC_MENU|BUTTON_REL, BUTTON_RC_MENU },
401 { ACTION_WPS_QUICKSCREEN, BUTTON_RC_MENU|BUTTON_REPEAT, BUTTON_RC_MENU },
403 LAST_ITEM_IN_LIST
404 }; /* remote_button_context_wps */
406 /** Yes/No Screen **/
407 static const struct button_mapping button_context_yesnoscreen[] = {
408 { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
409 LAST_ITEM_IN_LIST
410 }; /* button_context_settings_yesnoscreen */
412 static const struct button_mapping remote_button_context_yesnoscreen[] = {
413 { ACTION_YESNO_ACCEPT, BUTTON_RC_PLAY, BUTTON_NONE },
414 LAST_ITEM_IN_LIST
415 }; /* remote_button_context_settings_yesnoscreen */
418 static const struct button_mapping* get_context_mapping_remote( int context )
420 context ^= CONTEXT_REMOTE;
422 switch (context)
424 /* anything that uses remote_button_context_standard */
425 default:
426 return remote_button_context_standard;
428 /* remote contexts with special mapping */
429 case CONTEXT_BOOKMARKSCREEN:
430 return remote_button_context_bmark;
432 case CONTEXT_FM:
433 return remote_button_context_radio;
435 case CONTEXT_KEYBOARD:
436 case CONTEXT_MORSE_INPUT:
437 return remote_button_context_keyboard;
439 case CONTEXT_PITCHSCREEN:
440 return remote_button_context_pitchscreen;
442 case CONTEXT_QUICKSCREEN:
443 return remote_button_context_quickscreen;
445 case CONTEXT_RECSCREEN:
446 return remote_button_context_recscreen;
448 case CONTEXT_SETTINGS:
449 return remote_button_context_settings;
451 case CONTEXT_SETTINGS_COLOURCHOOSER:
452 case CONTEXT_SETTINGS_EQ:
453 case CONTEXT_SETTINGS_TIME:
454 return remote_button_context_settings_r_is_inc;
456 case CONTEXT_TREE:
457 case CONTEXT_MAINMENU:
458 if (global_settings.hold_lr_for_scroll_in_list)
459 return remote_button_context_tree_scroll_lr;
460 /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */
461 case CONTEXT_TREE|CONTEXT_CUSTOM:
462 return remote_button_context_tree;
464 case CONTEXT_WPS:
465 return remote_button_context_wps;
467 case CONTEXT_YESNOSCREEN:
468 return remote_button_context_yesnoscreen;
472 const struct button_mapping* get_context_mapping( int context )
474 if (context & CONTEXT_REMOTE)
475 return get_context_mapping_remote(context);
477 switch( context )
479 /* anything that uses button_context_standard */
480 case CONTEXT_LIST:
481 case CONTEXT_STD:
482 default:
483 return button_context_standard;
485 /* contexts with special mapping */
486 case CONTEXT_BOOKMARKSCREEN:
487 return button_context_bmark;
489 case CONTEXT_FM:
490 return button_context_radio;
492 case CONTEXT_KEYBOARD:
493 case CONTEXT_MORSE_INPUT:
494 return button_context_keyboard;
496 case CONTEXT_PITCHSCREEN:
497 return button_context_pitchscreen;
499 case CONTEXT_QUICKSCREEN:
500 return button_context_quickscreen;
502 case CONTEXT_RECSCREEN:
503 return button_context_recscreen;
505 case CONTEXT_SETTINGS:
506 return button_context_settings;
508 case CONTEXT_SETTINGS_COLOURCHOOSER:
509 case CONTEXT_SETTINGS_EQ:
510 case CONTEXT_SETTINGS_RECTRIGGER:
511 return button_context_settings_r_is_inc;
513 case CONTEXT_SETTINGS_TIME:
514 return button_context_settings_time;
516 case CONTEXT_TREE:
517 case CONTEXT_MAINMENU:
518 if (global_settings.hold_lr_for_scroll_in_list)
519 return button_context_tree_scroll_lr;
520 /* else fall through to CONTEXT_TREE|CONTEXT_CUSTOM */
521 case CONTEXT_TREE|CONTEXT_CUSTOM:
522 return button_context_tree;
524 case CONTEXT_WPS:
525 return button_context_wps;
527 case CONTEXT_YESNOSCREEN:
528 return button_context_yesnoscreen;