diff options
Diffstat (limited to 'apps/keymaps')
-rw-r--r-- | apps/keymaps/keymap-hdd6330.c | 465 |
1 files changed, 465 insertions, 0 deletions
diff --git a/apps/keymaps/keymap-hdd6330.c b/apps/keymaps/keymap-hdd6330.c new file mode 100644 index 0000000000..f6f9ab9c8c --- /dev/null +++ b/apps/keymaps/keymap-hdd6330.c | |||
@@ -0,0 +1,465 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 Mark Arigo | ||
11 | * | ||
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. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | /* Button Code Definitions for the toshiba gigabeat target */ | ||
23 | #include <stdio.h> | ||
24 | #include <string.h> | ||
25 | #include <stdlib.h> | ||
26 | |||
27 | #include "config.h" | ||
28 | #include "action.h" | ||
29 | #include "button.h" | ||
30 | #include "settings.h" | ||
31 | |||
32 | /* | ||
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 | ||
37 | */ | ||
38 | |||
39 | /* CONTEXT_CUSTOM's used in this file... | ||
40 | |||
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 | ||
45 | |||
46 | */ | ||
47 | |||
48 | |||
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 }, | ||
54 | |||
55 | { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, | ||
56 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | ||
57 | |||
58 | { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT }, | ||
59 | |||
60 | { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
61 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
62 | |||
63 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
64 | { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, | ||
65 | |||
66 | LAST_ITEM_IN_LIST | ||
67 | }; /* button_context_standard */ | ||
68 | |||
69 | |||
70 | static const struct button_mapping button_context_wps[] = { | ||
71 | { ACTION_WPS_PLAY, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
72 | { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
73 | |||
74 | { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
75 | { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
76 | |||
77 | { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
78 | { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
79 | { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, | ||
80 | { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, | ||
81 | |||
82 | { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_NONE }, | ||
83 | { ACTION_WPS_ABSETA_PREVDIR, BUTTON_VIEW|BUTTON_LEFT, BUTTON_NONE }, | ||
84 | { ACTION_WPS_ABRESET, BUTTON_VIEW|BUTTON_SELECT, BUTTON_NONE }, | ||
85 | |||
86 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
87 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
88 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
89 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
90 | { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
91 | { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, | ||
92 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
93 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
94 | |||
95 | { ACTION_WPS_PITCHSCREEN, BUTTON_VIEW|BUTTON_UP, BUTTON_VIEW }, | ||
96 | { ACTION_WPS_VIEW_PLAYLIST, BUTTON_VIEW|BUTTON_DOWN, BUTTON_VIEW }, | ||
97 | |||
98 | { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
99 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
100 | { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
101 | |||
102 | { ACTION_WPS_ID3SCREEN, BUTTON_VIEW|BUTTON_MENU, BUTTON_NONE }, | ||
103 | { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
104 | |||
105 | LAST_ITEM_IN_LIST | ||
106 | }; /* button_context_wps */ | ||
107 | |||
108 | static const struct button_mapping button_context_list[] = { | ||
109 | { ACTION_LISTTREE_PGUP, BUTTON_VIEW|BUTTON_UP, BUTTON_VIEW }, | ||
110 | { ACTION_LISTTREE_PGUP, BUTTON_UP|BUTTON_REL, BUTTON_VIEW|BUTTON_UP }, | ||
111 | { ACTION_LISTTREE_PGUP, BUTTON_VIEW|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
112 | { ACTION_LISTTREE_PGDOWN, BUTTON_VIEW|BUTTON_DOWN, BUTTON_VIEW }, | ||
113 | { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_VIEW|BUTTON_DOWN }, | ||
114 | { ACTION_LISTTREE_PGDOWN, BUTTON_VIEW|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
115 | #ifdef HAVE_VOLUME_IN_LIST | ||
116 | { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
117 | { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
118 | { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
119 | { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
120 | #endif | ||
121 | |||
122 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
123 | }; /* button_context_list */ | ||
124 | |||
125 | static const struct button_mapping button_context_tree[] = { | ||
126 | { ACTION_TREE_WPS, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
127 | { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE }, | ||
128 | { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
129 | { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, | ||
130 | |||
131 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) | ||
132 | }; /* button_context_tree */ | ||
133 | |||
134 | static const struct button_mapping button_context_listtree_scroll_with_combo[] = { | ||
135 | { ACTION_NONE, BUTTON_VIEW, BUTTON_NONE }, | ||
136 | { ACTION_TREE_PGLEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_VIEW }, | ||
137 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_VIEW|BUTTON_LEFT }, | ||
138 | { ACTION_TREE_PGLEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_LEFT|BUTTON_REL }, | ||
139 | { ACTION_TREE_ROOT_INIT, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_VIEW|BUTTON_LEFT }, | ||
140 | { ACTION_TREE_PGLEFT, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
141 | { ACTION_TREE_PGRIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_VIEW }, | ||
142 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_VIEW|BUTTON_RIGHT }, | ||
143 | { ACTION_TREE_PGRIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_RIGHT|BUTTON_REL }, | ||
144 | { ACTION_TREE_PGRIGHT, BUTTON_VIEW|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
145 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | ||
146 | }; | ||
147 | |||
148 | static const struct button_mapping button_context_listtree_scroll_without_combo[] = { | ||
149 | { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, | ||
150 | { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
151 | { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, | ||
152 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
153 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, | ||
154 | { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, | ||
155 | { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
156 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
157 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, | ||
158 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | ||
159 | }; | ||
160 | |||
161 | static const struct button_mapping button_context_settings[] = { | ||
162 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, | ||
163 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
164 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, | ||
165 | { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
166 | { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, | ||
167 | { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
168 | { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, | ||
169 | { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
170 | { ACTION_SETTINGS_RESET, BUTTON_VIEW, BUTTON_NONE }, | ||
171 | |||
172 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
173 | }; /* button_context_settings */ | ||
174 | |||
175 | static const struct button_mapping button_context_settings_right_is_inc[] = { | ||
176 | { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, | ||
177 | { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
178 | { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, | ||
179 | { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
180 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, | ||
181 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
182 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
183 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
184 | { ACTION_SETTINGS_RESET, BUTTON_VIEW, BUTTON_NONE }, | ||
185 | |||
186 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
187 | }; /* button_context_settingsgraphical */ | ||
188 | |||
189 | static const struct button_mapping button_context_yesno[] = { | ||
190 | { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, | ||
191 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
192 | }; /* button_context_settings_yesno */ | ||
193 | |||
194 | static const struct button_mapping button_context_colorchooser[] = { | ||
195 | { ACTION_STD_OK, BUTTON_VIEW|BUTTON_REL, BUTTON_NONE }, | ||
196 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), | ||
197 | }; /* button_context_colorchooser */ | ||
198 | |||
199 | static const struct button_mapping button_context_eq[] = { | ||
200 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, | ||
201 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), | ||
202 | }; /* button_context_eq */ | ||
203 | |||
204 | /** Bookmark Screen **/ | ||
205 | static const struct button_mapping button_context_bmark[] = { | ||
206 | { ACTION_BMS_DELETE, BUTTON_VIEW, BUTTON_NONE }, | ||
207 | |||
208 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), | ||
209 | }; /* button_context_bmark */ | ||
210 | |||
211 | static const struct button_mapping button_context_time[] = { | ||
212 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | ||
213 | { ACTION_STD_OK, BUTTON_VIEW, BUTTON_NONE }, | ||
214 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), | ||
215 | }; /* button_context_time */ | ||
216 | |||
217 | static const struct button_mapping button_context_quickscreen[] = { | ||
218 | { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE }, | ||
219 | { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
220 | { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
221 | { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
222 | { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
223 | { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
224 | { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
225 | { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
226 | { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE }, | ||
227 | |||
228 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
229 | }; /* button_context_quickscreen */ | ||
230 | |||
231 | static const struct button_mapping button_context_pitchscreen[] = { | ||
232 | { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, | ||
233 | { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
234 | { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, | ||
235 | { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
236 | { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
237 | { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, | ||
238 | { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
239 | { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, | ||
240 | { ACTION_PS_TOGGLE_MODE, BUTTON_MENU, BUTTON_NONE }, | ||
241 | { ACTION_PS_RESET, BUTTON_VIEW, BUTTON_NONE }, | ||
242 | { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE }, | ||
243 | { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
244 | { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
245 | |||
246 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
247 | }; /* button_context_pitchcreen */ | ||
248 | |||
249 | static const struct button_mapping button_context_keyboard[] = { | ||
250 | { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
251 | { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
252 | { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
253 | { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
254 | { ACTION_KBD_CURSOR_LEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_NONE }, | ||
255 | { ACTION_KBD_CURSOR_LEFT, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
256 | { ACTION_KBD_CURSOR_RIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_NONE }, | ||
257 | { ACTION_KBD_CURSOR_RIGHT, BUTTON_VIEW|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
258 | { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, | ||
259 | { ACTION_KBD_PAGE_FLIP, BUTTON_VIEW|BUTTON_MENU, BUTTON_NONE }, | ||
260 | { ACTION_KBD_DONE, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
261 | { ACTION_KBD_ABORT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
262 | { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE }, | ||
263 | { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | ||
264 | { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, | ||
265 | { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
266 | { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
267 | { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
268 | { ACTION_KBD_MORSE_INPUT, BUTTON_VIEW|BUTTON_POWER, BUTTON_NONE }, | ||
269 | { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, | ||
270 | |||
271 | LAST_ITEM_IN_LIST | ||
272 | }; /* button_context_keyboard */ | ||
273 | |||
274 | #if CONFIG_TUNER | ||
275 | static const struct button_mapping button_context_radio[] = { | ||
276 | { ACTION_FM_MENU, BUTTON_MENU | BUTTON_REL, BUTTON_MENU }, | ||
277 | { ACTION_FM_MODE, BUTTON_MENU | BUTTON_REPEAT, BUTTON_MENU }, | ||
278 | { ACTION_FM_PRESET, BUTTON_VIEW, BUTTON_NONE }, | ||
279 | { ACTION_FM_PLAY, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT }, | ||
280 | { ACTION_FM_STOP, BUTTON_SELECT | BUTTON_REPEAT, BUTTON_SELECT }, | ||
281 | { ACTION_FM_EXIT, BUTTON_POWER, BUTTON_NONE }, | ||
282 | |||
283 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS) | ||
284 | }; | ||
285 | #endif | ||
286 | |||
287 | #ifdef USB_ENABLE_HID | ||
288 | static const struct button_mapping button_context_usb_hid[] = { | ||
289 | { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
290 | { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_POWER|BUTTON_REPEAT, BUTTON_POWER }, | ||
291 | |||
292 | LAST_ITEM_IN_LIST | ||
293 | }; /* button_context_usb_hid */ | ||
294 | |||
295 | static const struct button_mapping button_context_usb_hid_mode_multimedia[] = { | ||
296 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
297 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
298 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
299 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
300 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
301 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
302 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
303 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAYLIST|BUTTON_REL, BUTTON_PLAYLIST }, | ||
304 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
305 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
306 | |||
307 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
308 | }; /* button_context_usb_hid_mode_multimedia */ | ||
309 | |||
310 | static const struct button_mapping button_context_usb_hid_mode_presentation[] = { | ||
311 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
312 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
313 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
314 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_VIEW|BUTTON_REPEAT, BUTTON_VIEW }, | ||
315 | { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
316 | { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
317 | { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, | ||
318 | { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT }, | ||
319 | { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_PLAYLIST|BUTTON_REL, BUTTON_PLAYLIST }, | ||
320 | { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_PLAYLIST|BUTTON_REPEAT, BUTTON_PLAYLIST }, | ||
321 | { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REL, BUTTON_VOL_UP }, | ||
322 | { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_UP }, | ||
323 | { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_VOL_DOWN }, | ||
324 | { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_VOL_DOWN }, | ||
325 | { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
326 | { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
327 | |||
328 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
329 | }; /* button_context_usb_hid_mode_presentation */ | ||
330 | |||
331 | static const struct button_mapping button_context_usb_hid_mode_browser[] = { | ||
332 | { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP, BUTTON_NONE }, | ||
333 | { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
334 | { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
335 | { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
336 | { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_VOL_UP|BUTTON_REL, BUTTON_VOL_UP }, | ||
337 | { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_VOL_DOWN|BUTTON_REL, BUTTON_VOL_DOWN }, | ||
338 | { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_VOL_UP }, | ||
339 | { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_VOL_DOWN }, | ||
340 | { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
341 | { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
342 | { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
343 | { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_PLAYLIST|BUTTON_REPEAT, BUTTON_PLAYLIST }, | ||
344 | { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, | ||
345 | { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT }, | ||
346 | { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_VIEW|BUTTON_REL, BUTTON_VIEW }, | ||
347 | |||
348 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
349 | }; /* button_context_usb_hid_mode_browser */ | ||
350 | |||
351 | #ifdef HAVE_USB_HID_MOUSE | ||
352 | static const struct button_mapping button_context_usb_hid_mode_mouse[] = { | ||
353 | { ACTION_USB_HID_MOUSE_UP, BUTTON_UP, BUTTON_NONE }, | ||
354 | { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
355 | { ACTION_USB_HID_MOUSE_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
356 | { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
357 | { ACTION_USB_HID_MOUSE_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
358 | { ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
359 | { ACTION_USB_HID_MOUSE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
360 | { ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
361 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_SELECT, BUTTON_NONE }, | ||
362 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, | ||
363 | { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_SELECT|BUTTON_UP, BUTTON_NONE }, | ||
364 | { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_SELECT|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
365 | { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_NONE }, | ||
366 | { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_SELECT|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
367 | { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_SELECT|BUTTON_LEFT, BUTTON_NONE }, | ||
368 | { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_SELECT|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
369 | { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_SELECT|BUTTON_RIGHT, BUTTON_NONE }, | ||
370 | { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_SELECT|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
371 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_PLAYLIST, BUTTON_NONE }, | ||
372 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_PLAYLIST|BUTTON_REL, BUTTON_NONE }, | ||
373 | { ACTION_USB_HID_MOUSE_LDRAG_UP, BUTTON_PLAYLIST|BUTTON_UP, BUTTON_NONE }, | ||
374 | { ACTION_USB_HID_MOUSE_LDRAG_UP_REP, BUTTON_PLAYLIST|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
375 | { ACTION_USB_HID_MOUSE_LDRAG_DOWN, BUTTON_PLAYLIST|BUTTON_DOWN, BUTTON_NONE }, | ||
376 | { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP, BUTTON_PLAYLIST|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
377 | { ACTION_USB_HID_MOUSE_LDRAG_LEFT, BUTTON_PLAYLIST|BUTTON_LEFT, BUTTON_NONE }, | ||
378 | { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP, BUTTON_PLAYLIST|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
379 | { ACTION_USB_HID_MOUSE_LDRAG_RIGHT, BUTTON_PLAYLIST|BUTTON_RIGHT, BUTTON_NONE }, | ||
380 | { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP, BUTTON_PLAYLIST|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
381 | { ACTION_USB_HID_MOUSE_BUTTON_RIGHT, BUTTON_VIEW, BUTTON_NONE }, | ||
382 | { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL, BUTTON_VIEW|BUTTON_REL, BUTTON_NONE }, | ||
383 | { ACTION_USB_HID_MOUSE_RDRAG_UP, BUTTON_VIEW|BUTTON_UP, BUTTON_NONE }, | ||
384 | { ACTION_USB_HID_MOUSE_RDRAG_UP_REP, BUTTON_VIEW|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
385 | { ACTION_USB_HID_MOUSE_RDRAG_DOWN, BUTTON_VIEW|BUTTON_DOWN, BUTTON_NONE }, | ||
386 | { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP, BUTTON_VIEW|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
387 | { ACTION_USB_HID_MOUSE_RDRAG_LEFT, BUTTON_VIEW|BUTTON_LEFT, BUTTON_NONE }, | ||
388 | { ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP, BUTTON_VIEW|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
389 | { ACTION_USB_HID_MOUSE_RDRAG_RIGHT, BUTTON_VIEW|BUTTON_RIGHT, BUTTON_NONE }, | ||
390 | { ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP, BUTTON_VIEW|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
391 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
392 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
393 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
394 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
395 | |||
396 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
397 | |||
398 | }; /* button_context_usb_hid_mode_mouse */ | ||
399 | #endif | ||
400 | #endif | ||
401 | |||
402 | const struct button_mapping* get_context_mapping(int context) | ||
403 | { | ||
404 | switch (context) | ||
405 | { | ||
406 | case CONTEXT_STD: | ||
407 | return button_context_standard; | ||
408 | case CONTEXT_WPS: | ||
409 | return button_context_wps; | ||
410 | |||
411 | case CONTEXT_LIST: | ||
412 | return button_context_list; | ||
413 | case CONTEXT_MAINMENU: | ||
414 | case CONTEXT_TREE: | ||
415 | if (global_settings.hold_lr_for_scroll_in_list) | ||
416 | return button_context_listtree_scroll_without_combo; | ||
417 | else | ||
418 | return button_context_listtree_scroll_with_combo; | ||
419 | case CONTEXT_CUSTOM|CONTEXT_TREE: | ||
420 | return button_context_tree; | ||
421 | |||
422 | case CONTEXT_SETTINGS: | ||
423 | return button_context_settings; | ||
424 | case CONTEXT_CUSTOM|CONTEXT_SETTINGS: | ||
425 | return button_context_settings_right_is_inc; | ||
426 | |||
427 | case CONTEXT_SETTINGS_COLOURCHOOSER: | ||
428 | return button_context_colorchooser; | ||
429 | case CONTEXT_SETTINGS_EQ: | ||
430 | return button_context_eq; | ||
431 | |||
432 | case CONTEXT_SETTINGS_TIME: | ||
433 | return button_context_time; | ||
434 | |||
435 | case CONTEXT_YESNOSCREEN: | ||
436 | return button_context_yesno; | ||
437 | case CONTEXT_BOOKMARKSCREEN: | ||
438 | return button_context_bmark; | ||
439 | case CONTEXT_QUICKSCREEN: | ||
440 | return button_context_quickscreen; | ||
441 | case CONTEXT_PITCHSCREEN: | ||
442 | return button_context_pitchscreen; | ||
443 | case CONTEXT_KEYBOARD: | ||
444 | return button_context_keyboard; | ||
445 | #if CONFIG_TUNER | ||
446 | case CONTEXT_FM: | ||
447 | return button_context_radio; | ||
448 | #endif | ||
449 | #ifdef USB_ENABLE_HID | ||
450 | case CONTEXT_USB_HID: | ||
451 | return button_context_usb_hid; | ||
452 | case CONTEXT_USB_HID_MODE_MULTIMEDIA: | ||
453 | return button_context_usb_hid_mode_multimedia; | ||
454 | case CONTEXT_USB_HID_MODE_PRESENTATION: | ||
455 | return button_context_usb_hid_mode_presentation; | ||
456 | case CONTEXT_USB_HID_MODE_BROWSER: | ||
457 | return button_context_usb_hid_mode_browser; | ||
458 | #ifdef HAVE_USB_HID_MOUSE | ||
459 | case CONTEXT_USB_HID_MODE_MOUSE: | ||
460 | return button_context_usb_hid_mode_mouse; | ||
461 | #endif | ||
462 | #endif | ||
463 | } | ||
464 | return button_context_standard; | ||
465 | } | ||