diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/SOURCES | 2 | ||||
-rw-r--r-- | apps/debug_menu.c | 3 | ||||
-rw-r--r-- | apps/keymaps/keymap-vibe500.c | 338 |
3 files changed, 343 insertions, 0 deletions
diff --git a/apps/SOURCES b/apps/SOURCES index 00ba4a267d..f99c2bc640 100644 --- a/apps/SOURCES +++ b/apps/SOURCES | |||
@@ -261,4 +261,6 @@ keymaps/keymap-ondavx767.c | |||
261 | keymaps/keymap-yh8xx_yh9xx.c | 261 | keymaps/keymap-yh8xx_yh9xx.c |
262 | #elif CONFIG_KEYPAD == MINI2440_PAD | 262 | #elif CONFIG_KEYPAD == MINI2440_PAD |
263 | keymaps/keymap-mini2440.c | 263 | keymaps/keymap-mini2440.c |
264 | #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD | ||
265 | keymaps/keymap-vibe500.c | ||
264 | #endif | 266 | #endif |
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 5162fc5cca..aba3964369 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -984,6 +984,9 @@ static bool dbg_spdif(void) | |||
984 | #elif (CONFIG_KEYPAD == SAMSUNG_YH_PAD) | 984 | #elif (CONFIG_KEYPAD == SAMSUNG_YH_PAD) |
985 | # define DEBUG_CANCEL BUTTON_PLAY | 985 | # define DEBUG_CANCEL BUTTON_PLAY |
986 | 986 | ||
987 | #elif (CONFIG_KEYPAD == PBELL_VIBE500_PAD) | ||
988 | # define DEBUG_CANCEL BUTTON_CANCEL | ||
989 | |||
987 | #endif /* key definitions */ | 990 | #endif /* key definitions */ |
988 | 991 | ||
989 | /* Test code!!! */ | 992 | /* Test code!!! */ |
diff --git a/apps/keymaps/keymap-vibe500.c b/apps/keymaps/keymap-vibe500.c new file mode 100644 index 0000000000..5a779d2841 --- /dev/null +++ b/apps/keymaps/keymap-vibe500.c | |||
@@ -0,0 +1,338 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id:$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Szymon Dziok | ||
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 Packard Bell Vibe 500 target */ | ||
23 | /* This needs from someone with the actual target! */ | ||
24 | |||
25 | #include <stdio.h> | ||
26 | #include <string.h> | ||
27 | #include <stdlib.h> | ||
28 | |||
29 | #include "config.h" | ||
30 | #include "action.h" | ||
31 | #include "button.h" | ||
32 | #include "settings.h" | ||
33 | |||
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 | ||
39 | */ | ||
40 | static const struct button_mapping button_context_standard[] = { | ||
41 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, | ||
42 | { ACTION_STD_PREVREPEAT, BUTTON_UP, BUTTON_NONE }, | ||
43 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
44 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN, 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_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
51 | { ACTION_STD_CONTEXT, BUTTON_OK|BUTTON_REPEAT, BUTTON_OK }, | ||
52 | |||
53 | LAST_ITEM_IN_LIST | ||
54 | }; /* button_context_standard */ | ||
55 | |||
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_UP, BUTTON_NONE }, | ||
66 | { ACTION_WPS_VOLDOWN, BUTTON_UP, BUTTON_NONE }, | ||
67 | { ACTION_WPS_VOLUP, BUTTON_DOWN, BUTTON_NONE }, | ||
68 | { ACTION_WPS_VOLUP, BUTTON_DOWN, BUTTON_NONE }, | ||
69 | { ACTION_WPS_BROWSE, BUTTON_OK|BUTTON_REL, BUTTON_OK }, | ||
70 | { ACTION_WPS_CONTEXT, BUTTON_OK|BUTTON_REPEAT, BUTTON_OK }, | ||
71 | { ACTION_WPS_VIEW_PLAYLIST, BUTTON_OK|BUTTON_PLAY, BUTTON_NONE }, | ||
72 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
73 | { ACTION_WPS_MENU, BUTTON_CANCEL|BUTTON_REL, BUTTON_MENU }, | ||
74 | { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
75 | |||
76 | LAST_ITEM_IN_LIST | ||
77 | }; /* button_context_wps */ | ||
78 | |||
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 | |||
83 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
84 | }; /* button_context_tree */ | ||
85 | |||
86 | static const struct button_mapping button_context_tree_scroll_lr[] = { | ||
87 | { ACTION_NONE, BUTTON_PREV, BUTTON_NONE }, | ||
88 | { ACTION_STD_CANCEL, BUTTON_PREV|BUTTON_REL, BUTTON_PREV }, | ||
89 | { ACTION_TREE_ROOT_INIT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV }, | ||
90 | { ACTION_TREE_PGLEFT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
91 | { ACTION_TREE_PGLEFT, BUTTON_PREV|BUTTON_REL, BUTTON_PREV|BUTTON_REPEAT }, | ||
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 }, | ||
95 | { ACTION_TREE_PGRIGHT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT|BUTTON_REPEAT }, | ||
96 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | ||
97 | }; /* button_context_tree_scroll_lr */ | ||
98 | |||
99 | static const struct button_mapping button_context_settings[] = { | ||
100 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, | ||
101 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP, BUTTON_NONE }, | ||
102 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, | ||
103 | { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN, 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 }, | ||
110 | |||
111 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
112 | }; /* button_context_settings */ | ||
113 | |||
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 */ | ||
118 | |||
119 | static const struct button_mapping button_context_bmark[] = { | ||
120 | { ACTION_BMS_DELETE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
121 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), | ||
122 | }; /* button_context_bmark */ | ||
123 | |||
124 | static const struct button_mapping button_context_quickscreen[] = { | ||
125 | { ACTION_QS_TOP, BUTTON_MENU, BUTTON_NONE }, | ||
126 | { ACTION_QS_TOP, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | ||
127 | { ACTION_QS_DOWN, BUTTON_PLAY, BUTTON_NONE }, | ||
128 | { ACTION_QS_DOWN, BUTTON_PLAY|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_CANCEL, BUTTON_NONE }, | ||
134 | |||
135 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
136 | }; /* button_context_quickscreen */ | ||
137 | |||
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_NONE }, | ||
141 | { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, | ||
142 | { ACTION_PS_DEC_BIG, BUTTON_DOWN, 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_CANCEL, BUTTON_NONE }, | ||
150 | { ACTION_PS_SLOWER, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
151 | { ACTION_PS_FASTER, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
152 | |||
153 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
154 | }; /* button_context_pitchscreen */ | ||
155 | |||
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_OK, BUTTON_NONE }, | ||
162 | { ACTION_KBD_DONE, BUTTON_PLAY, 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_NONE }, | ||
166 | { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
167 | { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
168 | { ACTION_KBD_MORSE_INPUT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
169 | { ACTION_KBD_MORSE_SELECT, BUTTON_OK|BUTTON_REL, BUTTON_NONE }, | ||
170 | LAST_ITEM_IN_LIST | ||
171 | }; /* button_context_keyboard */ | ||
172 | |||
173 | #ifdef HAVE_RECORDING | ||
174 | const struct button_mapping button_context_recscreen[] = { | ||
175 | |||
176 | { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC }, | ||
177 | { ACTION_STD_MENU, BUTTON_OK|BUTTON_REPEAT, BUTTON_OK }, | ||
178 | { ACTION_REC_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
179 | { ACTION_STD_CANCEL, BUTTON_CANCEL, BUTTON_NONE }, | ||
180 | { ACTION_STD_NEXT, BUTTON_UP, BUTTON_NONE }, | ||
181 | { ACTION_STD_NEXT, BUTTON_UP, BUTTON_NONE }, | ||
182 | { ACTION_STD_PREV, BUTTON_DOWN, BUTTON_NONE }, | ||
183 | { ACTION_STD_PREV, BUTTON_DOWN, BUTTON_NONE }, | ||
184 | { ACTION_SETTINGS_INC, BUTTON_NEXT, BUTTON_NONE }, | ||
185 | { ACTION_SETTINGS_INCREPEAT, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
186 | { ACTION_SETTINGS_DEC, BUTTON_PREV, BUTTON_NONE }, | ||
187 | { ACTION_SETTINGS_DECREPEAT, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
188 | |||
189 | LAST_ITEM_IN_LIST | ||
190 | }; /* button_context_recscreen */ | ||
191 | #endif | ||
192 | |||
193 | #ifdef USB_ENABLE_HID | ||
194 | static const struct button_mapping button_context_usb_hid[] = { | ||
195 | { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_REC|BUTTON_NEXT|BUTTON_REL, BUTTON_REC|BUTTON_NEXT }, | ||
196 | { ACTION_USB_HID_MODE_SWITCH_NEXT, BUTTON_REC|BUTTON_NEXT|BUTTON_REPEAT, BUTTON_REC|BUTTON_NEXT }, | ||
197 | { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_REC|BUTTON_PREV|BUTTON_REL, BUTTON_REC|BUTTON_PREV }, | ||
198 | { ACTION_USB_HID_MODE_SWITCH_PREV, BUTTON_REC|BUTTON_PREV|BUTTON_REPEAT, BUTTON_REC|BUTTON_PREV }, | ||
199 | |||
200 | LAST_ITEM_IN_LIST | ||
201 | }; /* button_context_usb_hid */ | ||
202 | |||
203 | static const struct button_mapping button_context_usb_hid_mode_multimedia[] = { | ||
204 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_UP, BUTTON_NONE }, | ||
205 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN, BUTTON_UP, BUTTON_NONE }, | ||
206 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_DOWN, BUTTON_NONE }, | ||
207 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP, BUTTON_DOWN, BUTTON_NONE }, | ||
208 | { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE, BUTTON_CANCEL|BUTTON_REL, BUTTON_CANCEL }, | ||
209 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
210 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
211 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
212 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV }, | ||
213 | { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT }, | ||
214 | |||
215 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
216 | }; /* button_context_usb_hid_mode_multimedia */ | ||
217 | |||
218 | static const struct button_mapping button_context_usb_hid_mode_presentation[] = { | ||
219 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
220 | { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
221 | { ACTION_USB_HID_PRESENTATION_SLIDE_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV }, | ||
222 | { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT }, | ||
223 | { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV }, | ||
224 | { ACTION_USB_HID_PRESENTATION_SLIDE_LAST, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT }, | ||
225 | { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK, BUTTON_CANCEL|BUTTON_REL, BUTTON_CANCEL }, | ||
226 | { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
227 | { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP, BUTTON_NONE }, | ||
228 | { ACTION_USB_HID_PRESENTATION_LINK_PREV, BUTTON_UP, BUTTON_NONE }, | ||
229 | { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
230 | { ACTION_USB_HID_PRESENTATION_LINK_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
231 | { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK, BUTTON_OK|BUTTON_REL, BUTTON_OK }, | ||
232 | { ACTION_USB_HID_PRESENTATION_MOUSE_OVER, BUTTON_OK|BUTTON_REPEAT, BUTTON_OK }, | ||
233 | |||
234 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
235 | }; /* button_context_usb_hid_mode_presentation */ | ||
236 | |||
237 | static const struct button_mapping button_context_usb_hid_mode_browser[] = { | ||
238 | { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP, BUTTON_NONE }, | ||
239 | { ACTION_USB_HID_BROWSER_SCROLL_UP, BUTTON_UP, BUTTON_NONE }, | ||
240 | { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
241 | { ACTION_USB_HID_BROWSER_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
242 | { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY }, | ||
243 | { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
244 | { ACTION_USB_HID_BROWSER_ZOOM_IN, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY }, | ||
245 | { ACTION_USB_HID_BROWSER_ZOOM_OUT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
246 | { ACTION_USB_HID_BROWSER_ZOOM_RESET, BUTTON_CANCEL|BUTTON_REL, BUTTON_CANCEL }, | ||
247 | { ACTION_USB_HID_BROWSER_TAB_PREV, BUTTON_PREV|BUTTON_REL, BUTTON_PREV }, | ||
248 | { ACTION_USB_HID_BROWSER_TAB_NEXT, BUTTON_NEXT|BUTTON_REL, BUTTON_NEXT }, | ||
249 | { ACTION_USB_HID_BROWSER_TAB_CLOSE, BUTTON_CANCEL|BUTTON_REL, BUTTON_CANCEL }, | ||
250 | { ACTION_USB_HID_BROWSER_HISTORY_BACK, BUTTON_PREV|BUTTON_REPEAT, BUTTON_PREV }, | ||
251 | { ACTION_USB_HID_BROWSER_HISTORY_FORWARD, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NEXT }, | ||
252 | { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN, BUTTON_OK|BUTTON_REL, BUTTON_OK }, | ||
253 | |||
254 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
255 | }; /* button_context_usb_hid_mode_browser */ | ||
256 | |||
257 | #ifdef HAVE_USB_HID_MOUSE | ||
258 | static const struct button_mapping button_context_usb_hid_mode_mouse[] = { | ||
259 | { ACTION_USB_HID_MOUSE_UP, BUTTON_OK, BUTTON_NONE }, | ||
260 | { ACTION_USB_HID_MOUSE_UP_REP, BUTTON_OK|BUTTON_REPEAT, BUTTON_NONE }, | ||
261 | { ACTION_USB_HID_MOUSE_DOWN, BUTTON_CANCEL, BUTTON_NONE }, | ||
262 | { ACTION_USB_HID_MOUSE_DOWN_REP, BUTTON_CANCEL|BUTTON_REPEAT, BUTTON_NONE }, | ||
263 | { ACTION_USB_HID_MOUSE_LEFT, BUTTON_PREV, BUTTON_NONE }, | ||
264 | { ACTION_USB_HID_MOUSE_LEFT_REP, BUTTON_PREV|BUTTON_REPEAT, BUTTON_NONE }, | ||
265 | { ACTION_USB_HID_MOUSE_RIGHT, BUTTON_NEXT, BUTTON_NONE }, | ||
266 | { ACTION_USB_HID_MOUSE_RIGHT_REP, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE }, | ||
267 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT, BUTTON_MENU, BUTTON_NONE }, | ||
268 | { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL, BUTTON_MENU|BUTTON_REL, BUTTON_NONE }, | ||
269 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_UP, BUTTON_NONE }, | ||
270 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP, BUTTON_UP, BUTTON_NONE }, | ||
271 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
272 | { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
273 | |||
274 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID) | ||
275 | }; /* button_context_usb_hid_mode_mouse */ | ||
276 | #endif | ||
277 | #endif | ||
278 | |||
279 | /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ | ||
280 | const struct button_mapping* get_context_mapping(int context) | ||
281 | { | ||
282 | switch (context) | ||
283 | { | ||
284 | case CONTEXT_STD: | ||
285 | return button_context_standard; | ||
286 | case CONTEXT_WPS: | ||
287 | return button_context_wps; | ||
288 | |||
289 | case CONTEXT_TREE: | ||
290 | case CONTEXT_MAINMENU: | ||
291 | if (global_settings.hold_lr_for_scroll_in_list) | ||
292 | return button_context_tree_scroll_lr; | ||
293 | /* else fall through to CUSTOM|CONTEXT_TREE */ | ||
294 | case CONTEXT_CUSTOM|CONTEXT_TREE: | ||
295 | return button_context_tree; | ||
296 | |||
297 | case CONTEXT_LIST: | ||
298 | return button_context_standard; | ||
299 | |||
300 | case CONTEXT_SETTINGS_EQ: | ||
301 | case CONTEXT_SETTINGS_COLOURCHOOSER: | ||
302 | case CONTEXT_SETTINGS_TIME: | ||
303 | case CONTEXT_SETTINGS: | ||
304 | case CONTEXT_SETTINGS_RECTRIGGER: | ||
305 | return button_context_settings; | ||
306 | case CONTEXT_YESNOSCREEN: | ||
307 | return button_context_yesno; | ||
308 | case CONTEXT_BOOKMARKSCREEN: | ||
309 | return button_context_bmark; | ||
310 | case CONTEXT_QUICKSCREEN: | ||
311 | return button_context_quickscreen; | ||
312 | case CONTEXT_PITCHSCREEN: | ||
313 | return button_context_pitchscreen; | ||
314 | case CONTEXT_KEYBOARD: | ||
315 | return button_context_keyboard; | ||
316 | #ifdef HAVE_RECORDING | ||
317 | case CONTEXT_RECSCREEN: | ||
318 | return button_context_recscreen; | ||
319 | #endif | ||
320 | #ifdef USB_ENABLE_HID | ||
321 | case CONTEXT_USB_HID: | ||
322 | return button_context_usb_hid; | ||
323 | case CONTEXT_USB_HID_MODE_MULTIMEDIA: | ||
324 | return button_context_usb_hid_mode_multimedia; | ||
325 | case CONTEXT_USB_HID_MODE_PRESENTATION: | ||
326 | return button_context_usb_hid_mode_presentation; | ||
327 | case CONTEXT_USB_HID_MODE_BROWSER: | ||
328 | return button_context_usb_hid_mode_browser; | ||
329 | #ifdef HAVE_USB_HID_MOUSE | ||
330 | case CONTEXT_USB_HID_MODE_MOUSE: | ||
331 | return button_context_usb_hid_mode_mouse; | ||
332 | #endif | ||
333 | #endif | ||
334 | default: | ||
335 | return button_context_standard; | ||
336 | } | ||
337 | return button_context_standard; | ||
338 | } | ||