A bit of indentation/whitespace changes in the xml files.
[kugel-rb.git] / apps / keymaps / keymap-hdd6330.c
blob950ebaef72e674d25727de445a672196d32c4012
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2008 Mark Arigo
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 Philips Gogear HDD63x0 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
48 static const struct button_mapping button_context_standard[] = {
49 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
50 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
51 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
52 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
53 { ACTION_STD_CANCEL, BUTTON_PREV, BUTTON_NONE },
54 { ACTION_STD_OK, BUTTON_NEXT, BUTTON_NONE },
55 { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
56 { ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
57 { ACTION_STD_QUICKSCREEN, BUTTON_VIEW|BUTTON_REPEAT, BUTTON_VIEW },
59 LAST_ITEM_IN_LIST
60 }; /* button_context_standard */
62 static const struct button_mapping button_context_wps[] = {
63 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
64 { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
65 { ACTION_WPS_SKIPNEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
66 { ACTION_WPS_SKIPPREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
67 { ACTION_WPS_SEEKBACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
68 { ACTION_WPS_SEEKFWD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
69 { ACTION_WPS_STOPSEEK, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT },
70 { ACTION_WPS_STOPSEEK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT },
71 { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
72 { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
73 { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
74 { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
75 { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
76 { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
77 { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
78 { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
79 { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
80 { ACTION_WPS_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
81 { ACTION_WPS_HOTKEY, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW },
82 { ACTION_WPS_QUICKSCREEN, BUTTON_VIEW|BUTTON_REPEAT, BUTTON_VIEW },
83 { ACTION_WPS_VIEW_PLAYLIST, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT},
84 { ACTION_WPS_BROWSE, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
86 LAST_ITEM_IN_LIST
87 }; /* button_context_wps */
89 static const struct button_mapping button_context_list[] = {
90 { ACTION_LISTTREE_PGUP, BUTTON_VIEW|BUTTON_UP, BUTTON_VIEW },
91 { ACTION_LISTTREE_PGUP, BUTTON_UP|BUTTON_REL, BUTTON_VIEW|BUTTON_UP },
92 { ACTION_LISTTREE_PGUP, BUTTON_VIEW|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
93 { ACTION_LISTTREE_PGDOWN, BUTTON_VIEW|BUTTON_DOWN, BUTTON_VIEW },
94 { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_VIEW|BUTTON_DOWN },
95 { ACTION_LISTTREE_PGDOWN, BUTTON_VIEW|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
96 #ifdef HAVE_VOLUME_IN_LIST
97 { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
98 { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
99 { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
100 { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
101 #endif
103 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
104 }; /* button_context_list */
106 static const struct button_mapping button_context_tree[] = {
107 { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
108 { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
109 { ACTION_TREE_HOTKEY, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW },
111 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST)
112 }; /* button_context_tree */
114 static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
115 { ACTION_NONE, BUTTON_VIEW, BUTTON_NONE },
116 { ACTION_TREE_PGLEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_VIEW },
117 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_VIEW|BUTTON_LEFT },
118 { ACTION_TREE_PGLEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_LEFT|BUTTON_REL },
119 { ACTION_TREE_ROOT_INIT, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_VIEW|BUTTON_LEFT },
120 { ACTION_TREE_PGLEFT, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
121 { ACTION_TREE_PGRIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_VIEW },
122 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_VIEW|BUTTON_RIGHT },
123 { ACTION_TREE_PGRIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_RIGHT|BUTTON_REL },
124 { ACTION_TREE_PGRIGHT, BUTTON_VIEW|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
125 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
128 static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
129 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
130 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
131 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
132 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
133 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
134 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
135 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
136 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
137 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
138 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
141 static const struct button_mapping button_context_settings[] = {
142 { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
143 { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
144 { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
145 { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
146 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
147 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
148 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
149 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
150 { ACTION_SETTINGS_RESET, BUTTON_VIEW, BUTTON_NONE },
152 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
153 }; /* button_context_settings */
155 static const struct button_mapping button_context_settings_right_is_inc[] = {
156 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
157 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
158 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
159 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
160 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
161 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
162 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
163 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
164 { ACTION_SETTINGS_RESET, BUTTON_VIEW, BUTTON_NONE },
166 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
167 }; /* button_context_settingsgraphical */
169 static const struct button_mapping button_context_yesno[] = {
170 { ACTION_YESNO_ACCEPT, BUTTON_NEXT, BUTTON_NONE },
171 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
172 }; /* button_context_settings_yesno */
174 static const struct button_mapping button_context_colorchooser[] = {
175 { ACTION_STD_OK, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
176 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
177 }; /* button_context_colorchooser */
179 static const struct button_mapping button_context_eq[] = {
180 { ACTION_STD_OK, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
181 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS),
182 }; /* button_context_eq */
184 /** Bookmark Screen **/
185 static const struct button_mapping button_context_bmark[] = {
186 { ACTION_BMS_DELETE, BUTTON_VIEW, BUTTON_NONE },
188 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
189 }; /* button_context_bmark */
191 static const struct button_mapping button_context_time[] = {
192 { ACTION_STD_CANCEL, BUTTON_PREV, BUTTON_NONE },
193 { ACTION_STD_OK, BUTTON_NEXT, BUTTON_NONE },
194 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS),
195 }; /* button_context_time */
197 static const struct button_mapping button_context_quickscreen[] = {
198 { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE },
199 { ACTION_QS_TOP, 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_VIEW, BUTTON_NONE },
208 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
209 }; /* button_context_quickscreen */
211 static const struct button_mapping button_context_pitchscreen[] = {
212 { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
213 { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
214 { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
215 { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
216 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
217 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
218 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
219 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
220 { ACTION_PS_TOGGLE_MODE, BUTTON_PLAY, BUTTON_NONE },
221 { ACTION_PS_RESET, BUTTON_VIEW, BUTTON_NONE },
222 { ACTION_PS_EXIT, BUTTON_PREV, BUTTON_NONE },
223 { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
224 { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
226 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
227 }; /* button_context_pitchcreen */
229 static const struct button_mapping button_context_keyboard[] = {
230 { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
231 { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
232 { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
233 { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
234 { ACTION_KBD_CURSOR_LEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_NONE },
235 { ACTION_KBD_CURSOR_LEFT, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
236 { ACTION_KBD_CURSOR_RIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_NONE },
237 { ACTION_KBD_CURSOR_RIGHT, BUTTON_VIEW|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
238 { ACTION_KBD_SELECT, BUTTON_PLAY, BUTTON_NONE },
239 { ACTION_KBD_PAGE_FLIP, BUTTON_VIEW|BUTTON_MENU, BUTTON_NONE },
240 { ACTION_KBD_DONE, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
241 { ACTION_KBD_ABORT, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
242 { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
243 { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
244 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
245 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
246 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
247 { ACTION_KBD_MORSE_INPUT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
248 { ACTION_KBD_MORSE_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
250 LAST_ITEM_IN_LIST
251 }; /* button_context_keyboard */
253 #if CONFIG_TUNER
254 static const struct button_mapping button_context_radio[] = {
255 { ACTION_FM_MENU, BUTTON_MENU | BUTTON_REL, BUTTON_MENU },
256 { ACTION_FM_MODE, BUTTON_MENU | BUTTON_REPEAT, BUTTON_MENU },
257 { ACTION_FM_PRESET, BUTTON_VIEW, BUTTON_NONE },
258 { ACTION_FM_PLAY, BUTTON_PLAY | BUTTON_REL, BUTTON_PLAY },
259 { ACTION_FM_STOP, BUTTON_PLAY | BUTTON_REPEAT, BUTTON_PLAY },
260 { ACTION_FM_EXIT, BUTTON_POWER, BUTTON_NONE },
262 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
264 #endif
266 #ifdef USB_ENABLE_HID
267 static const struct button_mapping button_context_usb_hid[] = {
268 { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_PLAY|BUTTON_NEXT|BUTTON_REL, BUTTON_PLAY|BUTTON_NEXT },
269 { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_PLAY|BUTTON_NEXT|BUTTON_REPEAT, BUTTON_PLAY|BUTTON_NEXT },
270 { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_PLAY|BUTTON_PREV|BUTTON_REL, BUTTON_PLAY|BUTTON_NEXT },
271 { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_PLAY|BUTTON_PREV|BUTTON_REPEAT, BUTTON_PLAY|BUTTON_NEXT },
273 LAST_ITEM_IN_LIST
274 }; /* button_context_usb_hid */
276 static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
277 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
278 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
279 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE },
280 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
281 { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
282 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
283 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
284 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
285 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT},
287 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
288 }; /* button_context_usb_hid_mode_multimedia */
290 static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
291 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
292 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
293 { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
294 { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
295 { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
296 { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
297 { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW },
298 { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_VIEW|BUTTON_REPEAT, BUTTON_VIEW },
299 { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REL, BUTTON_VOL_UP },
300 { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_UP },
301 { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_VOL_DOWN },
302 { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_VOL_DOWN },
303 { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
304 { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
306 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
307 }; /* button_context_usb_hid_mode_presentation */
309 static const struct button_mapping button_context_usb_hid_mode_browser[] = {
310 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP, BUTTON_NONE },
311 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
312 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE },
313 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
314 { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_VOL_UP },
315 { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_VOL_DOWN },
316 { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_UP },
317 { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_VOL_DOWN },
318 { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
319 { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
320 { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
321 { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
322 { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
323 { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
324 { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW },
326 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
327 }; /* button_context_usb_hid_mode_browser */
329 #ifdef HAVE_USB_HID_MOUSE
330 static const struct button_mapping button_context_usb_hid_mode_mouse[] = {
331 { ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
332 { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
333 { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE },
334 { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
335 { ACTION_USB_HID_MOUSE_LEFT, BUTTON_LEFT, BUTTON_NONE },
336 { ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
337 { ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
338 { ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
339 { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_PREV, BUTTON_NONE },
340 { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_PREV|BUTTON_REL, BUTTON_NONE },
341 { ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_NEXT, BUTTON_NONE },
342 { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
343 { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_MENU|BUTTON_UP, BUTTON_NONE },
344 { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_MENU|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
345 { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_MENU|BUTTON_DOWN, BUTTON_NONE },
346 { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_MENU|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
347 { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_MENU|BUTTON_LEFT, BUTTON_NONE },
348 { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_MENU|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
349 { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_MENU|BUTTON_RIGHT, BUTTON_NONE },
350 { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_MENU|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
351 { ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_VIEW|BUTTON_UP, BUTTON_NONE },
352 { ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_VIEW|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
353 { ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_VIEW|BUTTON_DOWN, BUTTON_NONE },
354 { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_VIEW|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
355 { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_NONE },
356 { ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
357 { ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_NONE },
358 { ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_VIEW|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
359 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE },
360 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
361 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
362 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
364 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
366 }; /* button_context_usb_hid_mode_mouse */
367 #endif
368 #endif
370 const struct button_mapping* get_context_mapping(int context)
372 switch (context)
374 case CONTEXT_STD:
375 return button_context_standard;
376 case CONTEXT_WPS:
377 return button_context_wps;
379 case CONTEXT_LIST:
380 return button_context_list;
381 case CONTEXT_MAINMENU:
382 case CONTEXT_TREE:
383 if (global_settings.hold_lr_for_scroll_in_list)
384 return button_context_listtree_scroll_without_combo;
385 else
386 return button_context_listtree_scroll_with_combo;
387 case CONTEXT_CUSTOM|CONTEXT_TREE:
388 return button_context_tree;
390 case CONTEXT_SETTINGS:
391 return button_context_settings;
392 case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
393 return button_context_settings_right_is_inc;
395 case CONTEXT_SETTINGS_COLOURCHOOSER:
396 return button_context_colorchooser;
397 case CONTEXT_SETTINGS_EQ:
398 return button_context_eq;
400 case CONTEXT_SETTINGS_TIME:
401 return button_context_time;
403 case CONTEXT_YESNOSCREEN:
404 return button_context_yesno;
405 case CONTEXT_BOOKMARKSCREEN:
406 return button_context_bmark;
407 case CONTEXT_QUICKSCREEN:
408 return button_context_quickscreen;
409 case CONTEXT_PITCHSCREEN:
410 return button_context_pitchscreen;
411 case CONTEXT_KEYBOARD:
412 case CONTEXT_MORSE_INPUT:
413 return button_context_keyboard;
414 #if CONFIG_TUNER
415 case CONTEXT_FM:
416 return button_context_radio;
417 #endif
418 #ifdef USB_ENABLE_HID
419 case CONTEXT_USB_HID:
420 return button_context_usb_hid;
421 case CONTEXT_USB_HID_MODE_MULTIMEDIA:
422 return button_context_usb_hid_mode_multimedia;
423 case CONTEXT_USB_HID_MODE_PRESENTATION:
424 return button_context_usb_hid_mode_presentation;
425 case CONTEXT_USB_HID_MODE_BROWSER:
426 return button_context_usb_hid_mode_browser;
427 #ifdef HAVE_USB_HID_MOUSE
428 case CONTEXT_USB_HID_MODE_MOUSE:
429 return button_context_usb_hid_mode_mouse;
430 #endif
431 #endif
433 return button_context_standard;