FS#12076 - DB stats resurrection: If the filename was changed, require
[kugel-rb.git] / apps / keymaps / keymap-vibe500.c
blob49f77628ce8037723bf165076a14ff58d09d2b1e
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2009 by Szymon Dziok
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 Packard Bell Vibe 500 target */
23 /* This needs from someone with the actual target! */
25 #include <stdio.h>
26 #include <string.h>
27 #include <stdlib.h>
29 #include "config.h"
30 #include "action.h"
31 #include "button.h"
32 #include "settings.h"
34 /*
35 * The format of the list is as follows
36 * { Action Code, Button code, Prereq button code }
37 * if there's no need to check the previous button's value, use BUTTON_NONE
38 * Insert LAST_ITEM_IN_LIST at the end of each mapping
40 static const struct button_mapping button_context_standard[] = {
41 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
42 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
43 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
44 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
45 { ACTION_STD_CANCEL, BUTTON_PREV, BUTTON_NONE },
46 { ACTION_STD_CANCEL, BUTTON_CANCEL|BUTTON_REL, BUTTON_NONE },
47 { ACTION_STD_OK, BUTTON_NEXT, BUTTON_NONE },
48 { ACTION_STD_OK, BUTTON_OK|BUTTON_REL, BUTTON_OK },
49 { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
50 { ACTION_STD_QUICKSCREEN, BUTTON_OK|BUTTON_REPEAT, BUTTON_OK },
51 { ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
53 LAST_ITEM_IN_LIST
54 }; /* button_context_standard */
56 static const struct button_mapping button_context_wps[] = {
57 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
58 { ACTION_WPS_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
59 { ACTION_WPS_SKIPPREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
60 { ACTION_WPS_SEEKBACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
61 { ACTION_WPS_STOPSEEK, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT },
62 { ACTION_WPS_SKIPNEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
63 { ACTION_WPS_SEEKFWD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
64 { ACTION_WPS_STOPSEEK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT },
65 { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
66 { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
67 { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
68 { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
69 { ACTION_WPS_BROWSE, BUTTON_OK|BUTTON_REL, BUTTON_OK },
70 { ACTION_WPS_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
71 { ACTION_WPS_HOTKEY, BUTTON_REC|BUTTON_REL, BUTTON_REC },
72 { ACTION_WPS_VIEW_PLAYLIST, BUTTON_CANCEL, BUTTON_NONE },
73 { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
74 { ACTION_WPS_QUICKSCREEN, BUTTON_OK|BUTTON_REPEAT, BUTTON_OK },
76 LAST_ITEM_IN_LIST
77 }; /* button_context_wps */
79 static const struct button_mapping button_context_tree[] = {
80 { ACTION_TREE_WPS, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
81 { ACTION_TREE_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
82 { ACTION_TREE_HOTKEY, BUTTON_REC|BUTTON_REL, BUTTON_REC },
84 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
85 }; /* button_context_tree */
87 static const struct button_mapping button_context_tree_scroll_lr[] = {
88 { ACTION_NONE, BUTTON_PREV, BUTTON_NONE },
89 { ACTION_STD_CANCEL, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
90 { ACTION_TREE_ROOT_INIT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV },
91 { ACTION_TREE_PGLEFT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
92 { ACTION_NONE, BUTTON_NEXT, BUTTON_NONE },
93 { ACTION_STD_OK, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
94 { ACTION_TREE_PGRIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
96 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
97 }; /* button_context_tree_scroll_lr */
99 static const struct button_mapping button_context_settings[] = {
100 { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
101 { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
102 { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
103 { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
104 { ACTION_STD_PREV, BUTTON_PREV, BUTTON_NONE },
105 { ACTION_STD_PREVREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
106 { ACTION_STD_NEXT, BUTTON_NEXT, BUTTON_NONE },
107 { ACTION_STD_NEXTREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
108 { ACTION_STD_OK, BUTTON_OK|BUTTON_REL, BUTTON_NONE },
109 { ACTION_STD_CANCEL, BUTTON_CANCEL|BUTTON_REL, BUTTON_CANCEL },
111 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
112 }; /* button_context_settings */
114 static const struct button_mapping button_context_yesno[] = {
115 { ACTION_YESNO_ACCEPT, BUTTON_OK, BUTTON_NONE },
116 LAST_ITEM_IN_LIST
117 }; /* button_context_yesno */
119 static const struct button_mapping button_context_bmark[] = {
120 { ACTION_BMS_DELETE, BUTTON_CANCEL|BUTTON_REPEAT, BUTTON_CANCEL },
121 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
122 }; /* button_context_bmark */
124 static const struct button_mapping button_context_quickscreen[] = {
125 { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE },
126 { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
127 { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
128 { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
129 { ACTION_QS_LEFT, BUTTON_PREV, BUTTON_NONE },
130 { ACTION_QS_LEFT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
131 { ACTION_QS_RIGHT, BUTTON_NEXT, BUTTON_NONE },
132 { ACTION_QS_RIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
133 { ACTION_STD_CANCEL, BUTTON_OK, BUTTON_NONE },
135 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
136 }; /* button_context_quickscreen */
138 static const struct button_mapping button_context_pitchscreen[] = {
139 { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
140 { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
141 { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
142 { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
143 { ACTION_PS_NUDGE_LEFT, BUTTON_PREV, BUTTON_NONE },
144 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_PREV|BUTTON_REL, BUTTON_NONE },
145 { ACTION_PS_NUDGE_RIGHT, BUTTON_NEXT, BUTTON_NONE },
146 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
147 { ACTION_PS_TOGGLE_MODE, BUTTON_PLAY, BUTTON_NONE },
148 { ACTION_PS_RESET, BUTTON_MENU, BUTTON_NONE },
149 { ACTION_PS_EXIT, BUTTON_OK, BUTTON_NONE },
150 { ACTION_PS_SLOWER, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
151 { ACTION_PS_FASTER, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
153 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
154 }; /* button_context_pitchscreen */
156 static const struct button_mapping button_context_keyboard[] = {
157 { ACTION_KBD_LEFT, BUTTON_PREV, BUTTON_NONE },
158 { ACTION_KBD_LEFT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
159 { ACTION_KBD_RIGHT, BUTTON_NEXT, BUTTON_NONE },
160 { ACTION_KBD_RIGHT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
161 { ACTION_KBD_SELECT, BUTTON_PLAY, BUTTON_NONE },
162 { ACTION_KBD_DONE, BUTTON_OK, BUTTON_NONE },
163 { ACTION_KBD_ABORT, BUTTON_CANCEL|BUTTON_REL, BUTTON_CANCEL },
164 { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
165 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
166 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
167 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
168 { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
169 { ACTION_KBD_MORSE_INPUT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
170 { ACTION_KBD_MORSE_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
172 LAST_ITEM_IN_LIST
173 }; /* button_context_keyboard */
175 #ifdef HAVE_RECORDING
176 const struct button_mapping button_context_recscreen[] = {
178 { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
179 { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
180 { ACTION_REC_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
181 { ACTION_STD_CANCEL, BUTTON_CANCEL, BUTTON_NONE },
182 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
183 { ACTION_STD_NEXT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
184 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
185 { ACTION_STD_PREV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
186 { ACTION_SETTINGS_INC, BUTTON_NEXT, BUTTON_NONE },
187 { ACTION_SETTINGS_INCREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
188 { ACTION_SETTINGS_DEC, BUTTON_PREV, BUTTON_NONE },
189 { ACTION_SETTINGS_DECREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
191 LAST_ITEM_IN_LIST
192 }; /* button_context_recscreen */
193 #endif
195 #ifdef USB_ENABLE_HID
196 static const struct button_mapping button_context_usb_hid[] = {
197 { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_OK|BUTTON_NEXT|BUTTON_REL, BUTTON_OK|BUTTON_NEXT },
198 { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_OK|BUTTON_NEXT|BUTTON_REPEAT, BUTTON_OK|BUTTON_NEXT },
199 { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_OK|BUTTON_PREV|BUTTON_REL, BUTTON_OK|BUTTON_PREV },
200 { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_OK|BUTTON_PREV|BUTTON_REPEAT, BUTTON_OK|BUTTON_PREV },
202 LAST_ITEM_IN_LIST
203 }; /* button_context_usb_hid */
205 static const struct button_mapping button_context_usb_hid_mode_multimedia[] = {
206 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_DOWN, BUTTON_NONE },
207 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
208 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_UP, BUTTON_NONE },
209 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
210 { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
211 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
212 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_CANCEL|BUTTON_REL, BUTTON_CANCEL },
213 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
214 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
215 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
217 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
218 }; /* button_context_usb_hid_mode_multimedia */
220 static const struct button_mapping button_context_usb_hid_mode_presentation[] = {
221 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
222 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
223 { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
224 { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
225 { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV },
226 { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT },
227 { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_CANCEL|BUTTON_REL, BUTTON_CANCEL },
228 { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
229 { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP, BUTTON_NONE },
230 { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
231 { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN, BUTTON_NONE },
232 { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
233 { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_OK|BUTTON_REL, BUTTON_OK },
234 { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_OK|BUTTON_REPEAT, BUTTON_OK },
236 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
237 }; /* button_context_usb_hid_mode_presentation */
239 static const struct button_mapping button_context_usb_hid_mode_browser[] = {
240 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP, BUTTON_NONE },
241 { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
242 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE },
243 { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
244 { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_OK|BUTTON_REL, BUTTON_OK },
245 { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_CANCEL|BUTTON_REL, BUTTON_CANCEL },
246 { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
247 { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
248 { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
249 { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV },
250 { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT },
251 { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_CANCEL|BUTTON_REPEAT, BUTTON_CANCEL },
252 { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV },
253 { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT },
254 { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_REC|BUTTON_REL, BUTTON_REC },
256 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
257 }; /* button_context_usb_hid_mode_browser */
259 #ifdef HAVE_USB_HID_MOUSE
260 static const struct button_mapping button_context_usb_hid_mode_mouse[] = {
261 { ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE },
262 { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
263 { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE },
264 { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
265 { ACTION_USB_HID_MOUSE_LEFT, BUTTON_PREV, BUTTON_NONE },
266 { ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE },
267 { ACTION_USB_HID_MOUSE_RIGHT, BUTTON_NEXT, BUTTON_NONE },
268 { ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
269 { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_MENU, BUTTON_NONE },
270 { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE },
271 { ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_PLAY, BUTTON_NONE },
272 { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
273 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_OK, BUTTON_NONE },
274 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_OK|BUTTON_REPEAT, BUTTON_NONE },
275 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_CANCEL, BUTTON_NONE },
276 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_CANCEL|BUTTON_REPEAT, BUTTON_NONE },
278 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID)
279 }; /* button_context_usb_hid_mode_mouse */
280 #endif
281 #endif
283 /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
284 const struct button_mapping* get_context_mapping(int context)
286 switch (context)
288 case CONTEXT_STD:
289 return button_context_standard;
290 case CONTEXT_WPS:
291 return button_context_wps;
293 case CONTEXT_TREE:
294 case CONTEXT_MAINMENU:
295 if (global_settings.hold_lr_for_scroll_in_list)
296 return button_context_tree_scroll_lr;
297 /* else fall through to CUSTOM|CONTEXT_TREE */
298 case CONTEXT_CUSTOM|CONTEXT_TREE:
299 return button_context_tree;
301 case CONTEXT_LIST:
302 return button_context_standard;
304 case CONTEXT_SETTINGS_EQ:
305 case CONTEXT_SETTINGS_COLOURCHOOSER:
306 case CONTEXT_SETTINGS_TIME:
307 case CONTEXT_SETTINGS:
308 case CONTEXT_SETTINGS_RECTRIGGER:
309 return button_context_settings;
310 case CONTEXT_YESNOSCREEN:
311 return button_context_yesno;
312 case CONTEXT_BOOKMARKSCREEN:
313 return button_context_bmark;
314 case CONTEXT_QUICKSCREEN:
315 return button_context_quickscreen;
316 case CONTEXT_PITCHSCREEN:
317 return button_context_pitchscreen;
318 case CONTEXT_KEYBOARD:
319 case CONTEXT_MORSE_INPUT:
320 return button_context_keyboard;
321 #ifdef HAVE_RECORDING
322 case CONTEXT_RECSCREEN:
323 return button_context_recscreen;
324 #endif
325 #ifdef USB_ENABLE_HID
326 case CONTEXT_USB_HID:
327 return button_context_usb_hid;
328 case CONTEXT_USB_HID_MODE_MULTIMEDIA:
329 return button_context_usb_hid_mode_multimedia;
330 case CONTEXT_USB_HID_MODE_PRESENTATION:
331 return button_context_usb_hid_mode_presentation;
332 case CONTEXT_USB_HID_MODE_BROWSER:
333 return button_context_usb_hid_mode_browser;
334 #ifdef HAVE_USB_HID_MOUSE
335 case CONTEXT_USB_HID_MODE_MOUSE:
336 return button_context_usb_hid_mode_mouse;
337 #endif
338 #endif
339 default:
340 return button_context_standard;
342 return button_context_standard;