1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 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 ****************************************************************************/
21 /* Button Code Definitions for Sandisk c100 target */
28 /* {Action Code, Button code, Prereq button code } */
31 * The format of the list is as follows
32 * { Action Code, Button code, Prereq button code }
33 * if there's no need to check the previous button's value, use BUTTON_NONE
34 * Insert LAST_ITEM_IN_LIST at the end of each mapping
36 static const struct button_mapping button_context_standard
[] = {
37 { ACTION_STD_PREV
, BUTTON_UP
, BUTTON_NONE
},
38 { ACTION_STD_PREVREPEAT
, BUTTON_UP
|BUTTON_REPEAT
, BUTTON_NONE
},
39 { ACTION_STD_NEXT
, BUTTON_DOWN
, BUTTON_NONE
},
40 { ACTION_STD_NEXTREPEAT
, BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
41 { ACTION_STD_OK
, BUTTON_SELECT
|BUTTON_REL
, BUTTON_SELECT
},
42 { ACTION_STD_OK
, BUTTON_RIGHT
, BUTTON_NONE
},
43 { ACTION_STD_CANCEL
, BUTTON_LEFT
, BUTTON_NONE
},
44 { ACTION_STD_MENU
, BUTTON_POWER
|BUTTON_REL
, BUTTON_POWER
},
45 { ACTION_STD_OK
, BUTTON_SELECT
|BUTTON_REL
, BUTTON_SELECT
},
46 { ACTION_STD_CONTEXT
, BUTTON_SELECT
|BUTTON_REPEAT
, BUTTON_SELECT
},
49 }; /* button_context_standard */
52 static const struct button_mapping button_context_wps
[] = {
53 { ACTION_WPS_PLAY
, BUTTON_UP
|BUTTON_REL
, BUTTON_UP
},
54 { ACTION_WPS_STOP
, BUTTON_POWER
|BUTTON_REL
, BUTTON_POWER
},
55 { ACTION_WPS_SKIPPREV
, BUTTON_LEFT
|BUTTON_REL
, BUTTON_LEFT
},
56 { ACTION_WPS_SEEKBACK
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
57 { ACTION_WPS_STOPSEEK
, BUTTON_LEFT
|BUTTON_REL
, BUTTON_LEFT
|BUTTON_REPEAT
},
59 { ACTION_WPS_SKIPNEXT
, BUTTON_RIGHT
|BUTTON_REL
, BUTTON_RIGHT
},
60 { ACTION_WPS_SEEKFWD
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
61 { ACTION_WPS_STOPSEEK
, BUTTON_RIGHT
|BUTTON_REL
,BUTTON_RIGHT
|BUTTON_REPEAT
},
63 { ACTION_WPS_ABSETB_NEXTDIR
,BUTTON_POWER
|BUTTON_RIGHT
, BUTTON_POWER
},
64 { ACTION_WPS_ABSETA_PREVDIR
,BUTTON_POWER
|BUTTON_LEFT
, BUTTON_POWER
},
65 { ACTION_WPS_ABRESET
, BUTTON_POWER
|BUTTON_UP
, BUTTON_POWER
},
67 { ACTION_WPS_MENU
, BUTTON_DOWN
|BUTTON_REL
, BUTTON_DOWN
},
68 { ACTION_WPS_BROWSE
, BUTTON_SELECT
|BUTTON_REL
, BUTTON_SELECT
},
69 { ACTION_WPS_PITCHSCREEN
, BUTTON_SELECT
|BUTTON_VOLUP
, BUTTON_SELECT
},
70 { ACTION_WPS_ID3SCREEN
, BUTTON_SELECT
|BUTTON_VOLDOWN
, BUTTON_SELECT
},
71 { ACTION_WPS_CONTEXT
, BUTTON_SELECT
|BUTTON_REPEAT
, BUTTON_SELECT
},
72 { ACTION_WPS_HOTKEY
, BUTTON_SELECT
|BUTTON_DOWN
, BUTTON_NONE
},
73 { ACTION_WPS_QUICKSCREEN
, BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_DOWN
},
76 }; /* button_context_wps */
78 static const struct button_mapping button_context_settings
[] = {
79 { ACTION_STD_CANCEL
, BUTTON_POWER
, BUTTON_NONE
},
80 { ACTION_SETTINGS_RESET
, BUTTON_SELECT
, BUTTON_NONE
},
81 { ACTION_SETTINGS_INC
, BUTTON_VOLUP
, BUTTON_NONE
},
82 { ACTION_SETTINGS_INCREPEAT
,BUTTON_VOLUP
|BUTTON_REPEAT
, BUTTON_NONE
},
83 { ACTION_SETTINGS_DEC
, BUTTON_VOLDOWN
, BUTTON_NONE
},
84 { ACTION_SETTINGS_DECREPEAT
,BUTTON_VOLDOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
85 { ACTION_STD_PREV
, BUTTON_LEFT
, BUTTON_NONE
},
86 { ACTION_STD_PREVREPEAT
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
87 { ACTION_STD_NEXT
, BUTTON_RIGHT
, BUTTON_NONE
},
88 { ACTION_STD_NEXTREPEAT
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
90 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
),
91 }; /* button_context_settings */
93 static const struct button_mapping button_context_list
[] = {
94 #ifdef HAVE_VOLUME_IN_LIST
95 { ACTION_LIST_VOLUP
, BUTTON_VOLUP
|BUTTON_REPEAT
, BUTTON_NONE
},
96 { ACTION_LIST_VOLUP
, BUTTON_VOLUP
, BUTTON_NONE
},
97 { ACTION_LIST_VOLDOWN
, BUTTON_VOLDOWN
, BUTTON_NONE
},
98 { ACTION_LIST_VOLDOWN
, BUTTON_VOLDOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
101 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
)
102 }; /* button_context_list */
104 static const struct button_mapping button_context_tree
[] = {
105 { ACTION_TREE_WPS
, BUTTON_UP
|BUTTON_REL
, BUTTON_UP
},
106 { ACTION_TREE_STOP
, BUTTON_POWER
|BUTTON_REL
, BUTTON_POWER
},
107 { ACTION_TREE_HOTKEY
, BUTTON_SELECT
|BUTTON_DOWN
, BUTTON_NONE
},
109 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST
),
110 }; /* button_context_tree */
112 static const struct button_mapping button_context_listtree_scroll_without_combo
[] = {
113 { ACTION_NONE
, BUTTON_LEFT
, BUTTON_NONE
},
114 { ACTION_STD_CANCEL
, BUTTON_LEFT
|BUTTON_REL
, BUTTON_LEFT
},
115 { ACTION_TREE_ROOT_INIT
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_LEFT
},
116 { ACTION_TREE_PGLEFT
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
117 { ACTION_TREE_PGLEFT
, BUTTON_LEFT
|BUTTON_REL
, BUTTON_LEFT
|BUTTON_REPEAT
},
118 { ACTION_NONE
, BUTTON_RIGHT
, BUTTON_NONE
},
119 { ACTION_STD_OK
, BUTTON_RIGHT
|BUTTON_REL
, BUTTON_RIGHT
},
120 { ACTION_TREE_PGRIGHT
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
121 { ACTION_TREE_PGRIGHT
, BUTTON_RIGHT
|BUTTON_REL
, BUTTON_RIGHT
|BUTTON_REPEAT
},
123 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM
|CONTEXT_TREE
),
124 }; /* button_context_listtree_scroll_without_combo */
126 static const struct button_mapping button_context_listtree_scroll_with_combo
[] = {
127 { ACTION_TREE_ROOT_INIT
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
129 // { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_REC },
130 // { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
132 // { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_REC },
133 // { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
135 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM
|CONTEXT_TREE
),
136 }; /* button_context_listtree_scroll_with_combo */
138 static const struct button_mapping button_context_yesno
[] = {
139 { ACTION_YESNO_ACCEPT
, BUTTON_SELECT
, BUTTON_NONE
},
141 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
),
142 }; /* button_context_settings_yesno */
144 static const struct button_mapping button_context_quickscreen
[] = {
145 { ACTION_STD_CANCEL
, BUTTON_POWER
, BUTTON_NONE
},
146 { ACTION_QS_TOP
, BUTTON_UP
|BUTTON_REL
, BUTTON_NONE
},
147 { ACTION_QS_TOP
, BUTTON_UP
|BUTTON_REPEAT
, BUTTON_NONE
},
148 { ACTION_QS_DOWN
, BUTTON_DOWN
|BUTTON_REL
, BUTTON_NONE
},
149 { ACTION_QS_DOWN
, BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
150 { ACTION_QS_LEFT
, BUTTON_LEFT
|BUTTON_REL
, BUTTON_NONE
},
151 { ACTION_QS_LEFT
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
152 { ACTION_QS_RIGHT
, BUTTON_RIGHT
|BUTTON_REL
, BUTTON_NONE
},
153 { ACTION_QS_RIGHT
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
155 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
),
156 }; /* button_context_quickscreen */
158 static const struct button_mapping button_context_settings_right_is_inc
[] = {
159 { ACTION_SETTINGS_INC
, BUTTON_RIGHT
, BUTTON_NONE
},
160 { ACTION_SETTINGS_INCREPEAT
,BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
161 { ACTION_SETTINGS_DEC
, BUTTON_LEFT
, BUTTON_NONE
},
162 { ACTION_SETTINGS_DECREPEAT
,BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
163 { ACTION_STD_CANCEL
, BUTTON_POWER
, BUTTON_NONE
},
165 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
),
166 }; /* button_context_settings_right_is_inc */
168 static const struct button_mapping button_context_pitchscreen
[] = {
169 { ACTION_PS_INC_SMALL
, BUTTON_VOLUP
, BUTTON_NONE
},
170 { ACTION_PS_INC_BIG
, BUTTON_VOLUP
|BUTTON_REPEAT
, BUTTON_NONE
},
171 { ACTION_PS_DEC_SMALL
, BUTTON_VOLDOWN
, BUTTON_NONE
},
172 { ACTION_PS_DEC_BIG
, BUTTON_VOLDOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
173 { ACTION_PS_NUDGE_LEFT
, BUTTON_LEFT
, BUTTON_NONE
},
174 { ACTION_PS_NUDGE_LEFTOFF
, BUTTON_LEFT
|BUTTON_REL
, BUTTON_NONE
},
175 { ACTION_PS_NUDGE_RIGHT
, BUTTON_RIGHT
, BUTTON_NONE
},
176 { ACTION_PS_NUDGE_RIGHTOFF
, BUTTON_RIGHT
|BUTTON_REL
, BUTTON_NONE
},
177 { ACTION_PS_RESET
, BUTTON_SELECT
, BUTTON_NONE
},
178 { ACTION_PS_EXIT
, BUTTON_POWER
, BUTTON_NONE
},
179 { ACTION_PS_SLOWER
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
180 { ACTION_PS_FASTER
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
182 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD
),
183 }; /* button_context_pitchscreen */
185 /** FM Radio Screen **/
187 static const struct button_mapping button_context_radio
[] = {
188 { ACTION_STD_PREV
, BUTTON_LEFT
, BUTTON_NONE
},
189 { ACTION_STD_PREVREPEAT
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
190 { ACTION_STD_NEXT
, BUTTON_RIGHT
, BUTTON_NONE
},
191 { ACTION_STD_NEXTREPEAT
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
192 { ACTION_FM_MENU
, BUTTON_SELECT
|BUTTON_REPEAT
, BUTTON_NONE
},
193 { ACTION_FM_PRESET
, BUTTON_SELECT
|BUTTON_REL
, BUTTON_NONE
},
194 { ACTION_FM_STOP
, BUTTON_POWER
|BUTTON_REL
, BUTTON_NONE
},
195 { ACTION_FM_MODE
, BUTTON_UP
|BUTTON_REPEAT
, BUTTON_UP
},
196 { ACTION_FM_EXIT
, BUTTON_DOWN
|BUTTON_REL
, BUTTON_NONE
},
197 { ACTION_FM_PLAY
, BUTTON_UP
|BUTTON_REL
, BUTTON_UP
},
198 { ACTION_FM_QUICKSCREEN
, BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_DOWN
},
200 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS
)
201 }; /* button_context_radio */
204 static const struct button_mapping button_context_keyboard
[] = {
205 { ACTION_KBD_LEFT
, BUTTON_LEFT
, BUTTON_NONE
},
206 { ACTION_KBD_LEFT
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
207 { ACTION_KBD_RIGHT
, BUTTON_RIGHT
, BUTTON_NONE
},
208 { ACTION_KBD_RIGHT
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
210 // { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_NONE },
211 // { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT,BUTTON_NONE },
212 // { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE },
213 // { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
215 { ACTION_KBD_UP
, BUTTON_VOLUP
, BUTTON_NONE
},
216 { ACTION_KBD_UP
, BUTTON_VOLUP
|BUTTON_REPEAT
, BUTTON_NONE
},
217 { ACTION_KBD_DOWN
, BUTTON_VOLDOWN
, BUTTON_NONE
},
218 { ACTION_KBD_DOWN
, BUTTON_VOLDOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
220 // { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN, BUTTON_NONE },
221 // { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN|BUTTON_REPEAT,BUTTON_NONE },
222 // { ACTION_KBD_PAGE_FLIP, BUTTON_REC|BUTTON_SELECT, BUTTON_REC },
224 { ACTION_KBD_SELECT
, BUTTON_SELECT
, BUTTON_NONE
},
225 { ACTION_KBD_DONE
, BUTTON_SELECT
|BUTTON_REPEAT
, BUTTON_SELECT
},
226 { ACTION_KBD_ABORT
, BUTTON_POWER
, BUTTON_NONE
},
229 }; /* button_context_keyboard */
231 static const struct button_mapping button_context_bmark
[] = {
232 // { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE },
234 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST
),
235 }; /* button_context_bmark */
237 #ifdef USB_ENABLE_HID
238 static const struct button_mapping button_context_usb_hid
[] = {
239 { ACTION_USB_HID_MODE_SWITCH_NEXT
, BUTTON_MODE
|BUTTON_REL
, BUTTON_MODE
},
240 { ACTION_USB_HID_MODE_SWITCH_PREV
, BUTTON_MODE
|BUTTON_REPEAT
, BUTTON_MODE
},
243 }; /* button_context_usb_hid */
245 static const struct button_mapping button_context_usb_hid_mode_multimedia
[] = {
246 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN
, BUTTON_VOLUP
, BUTTON_NONE
},
247 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN
, BUTTON_VOLUP
|BUTTON_REPEAT
, BUTTON_NONE
},
248 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP
, BUTTON_VOLDOWN
, BUTTON_NONE
},
249 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP
, BUTTON_VOLDOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
250 { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE
, BUTTON_SELECT
|BUTTON_REL
, BUTTON_SELECT
},
251 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE
, BUTTON_UP
|BUTTON_REL
, BUTTON_UP
},
252 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP
, BUTTON_POWER
|BUTTON_REL
, BUTTON_POWER
},
253 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV
, BUTTON_LEFT
|BUTTON_REL
, BUTTON_LEFT
},
254 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT
, BUTTON_RIGHT
|BUTTON_REL
, BUTTON_RIGHT
},
256 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID
)
257 }; /* button_context_usb_hid_mode_multimedia */
259 static const struct button_mapping button_context_usb_hid_mode_presentation
[] = {
260 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START
, BUTTON_UP
|BUTTON_REL
, BUTTON_UP
},
261 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE
, BUTTON_POWER
|BUTTON_REL
, BUTTON_POWER
},
262 { ACTION_USB_HID_PRESENTATION_SLIDE_PREV
, BUTTON_LEFT
|BUTTON_REL
, BUTTON_LEFT
},
263 { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT
, BUTTON_RIGHT
|BUTTON_REL
, BUTTON_RIGHT
},
264 { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_LEFT
},
265 { ACTION_USB_HID_PRESENTATION_SLIDE_LAST
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_RIGHT
},
266 { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK
, BUTTON_DOWN
|BUTTON_REL
, BUTTON_DOWN
},
267 { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE
, BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_DOWN
},
268 { ACTION_USB_HID_PRESENTATION_LINK_PREV
, BUTTON_VOLUP
, BUTTON_NONE
},
269 { ACTION_USB_HID_PRESENTATION_LINK_PREV
, BUTTON_VOLUP
|BUTTON_REPEAT
, BUTTON_NONE
},
270 { ACTION_USB_HID_PRESENTATION_LINK_NEXT
, BUTTON_VOLDOWN
, BUTTON_NONE
},
271 { ACTION_USB_HID_PRESENTATION_LINK_NEXT
, BUTTON_VOLDOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
272 { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK
, BUTTON_SELECT
|BUTTON_REL
, BUTTON_SELECT
},
273 { ACTION_USB_HID_PRESENTATION_MOUSE_OVER
, BUTTON_SELECT
|BUTTON_REPEAT
, BUTTON_SELECT
},
275 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID
)
276 }; /* button_context_usb_hid_mode_presentation */
278 static const struct button_mapping button_context_usb_hid_mode_browser
[] = {
279 { ACTION_USB_HID_BROWSER_SCROLL_UP
, BUTTON_VOLUP
, BUTTON_NONE
},
280 { ACTION_USB_HID_BROWSER_SCROLL_UP
, BUTTON_VOLUP
|BUTTON_REPEAT
, BUTTON_NONE
},
281 { ACTION_USB_HID_BROWSER_SCROLL_DOWN
, BUTTON_VOLDOWN
, BUTTON_NONE
},
282 { ACTION_USB_HID_BROWSER_SCROLL_DOWN
, BUTTON_VOLDOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
283 { ACTION_USB_HID_BROWSER_SCROLL_PAGE_UP
, BUTTON_UP
|BUTTON_REL
, BUTTON_UP
},
284 { ACTION_USB_HID_BROWSER_SCROLL_PAGE_DOWN
, BUTTON_DOWN
|BUTTON_REL
, BUTTON_DOWN
},
285 { ACTION_USB_HID_BROWSER_ZOOM_IN
, BUTTON_UP
|BUTTON_REPEAT
, BUTTON_UP
},
286 { ACTION_USB_HID_BROWSER_ZOOM_OUT
, BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_DOWN
},
287 { ACTION_USB_HID_BROWSER_ZOOM_RESET
, BUTTON_SELECT
|BUTTON_REPEAT
, BUTTON_SELECT
},
288 { ACTION_USB_HID_BROWSER_ZOOM_RESET
, BUTTON_UP
|BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_UP
|BUTTON_DOWN
},
289 { ACTION_USB_HID_BROWSER_TAB_PREV
, BUTTON_LEFT
|BUTTON_REL
, BUTTON_LEFT
},
290 { ACTION_USB_HID_BROWSER_TAB_NEXT
, BUTTON_RIGHT
|BUTTON_REL
, BUTTON_RIGHT
},
291 { ACTION_USB_HID_BROWSER_TAB_CLOSE
, BUTTON_POWER
|BUTTON_REPEAT
, BUTTON_POWER
},
292 { ACTION_USB_HID_BROWSER_HISTORY_BACK
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_LEFT
},
293 { ACTION_USB_HID_BROWSER_HISTORY_FORWARD
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_RIGHT
},
294 { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN
, BUTTON_SELECT
|BUTTON_REL
, BUTTON_SELECT
},
296 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID
)
297 }; /* button_context_usb_hid_mode_browser */
299 #ifdef HAVE_USB_HID_MOUSE
300 static const struct button_mapping button_context_usb_hid_mode_mouse
[] = {
301 { ACTION_USB_HID_MOUSE_UP
, BUTTON_UP
, BUTTON_NONE
},
302 { ACTION_USB_HID_MOUSE_UP_REP
, BUTTON_UP
|BUTTON_REPEAT
, BUTTON_NONE
},
303 { ACTION_USB_HID_MOUSE_DOWN
, BUTTON_DOWN
, BUTTON_NONE
},
304 { ACTION_USB_HID_MOUSE_DOWN_REP
, BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
305 { ACTION_USB_HID_MOUSE_LEFT
, BUTTON_LEFT
, BUTTON_NONE
},
306 { ACTION_USB_HID_MOUSE_LEFT_REP
, BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
307 { ACTION_USB_HID_MOUSE_RIGHT
, BUTTON_RIGHT
, BUTTON_NONE
},
308 { ACTION_USB_HID_MOUSE_RIGHT_REP
, BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
309 { ACTION_USB_HID_MOUSE_BUTTON_LEFT
, BUTTON_SELECT
, BUTTON_NONE
},
310 { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL
, BUTTON_SELECT
|BUTTON_REL
, BUTTON_NONE
},
311 { ACTION_USB_HID_MOUSE_LDRAG_UP
, BUTTON_SELECT
|BUTTON_UP
, BUTTON_NONE
},
312 { ACTION_USB_HID_MOUSE_LDRAG_UP_REP
, BUTTON_SELECT
|BUTTON_UP
|BUTTON_REPEAT
, BUTTON_NONE
},
313 { ACTION_USB_HID_MOUSE_LDRAG_DOWN
, BUTTON_SELECT
|BUTTON_DOWN
, BUTTON_NONE
},
314 { ACTION_USB_HID_MOUSE_LDRAG_DOWN_REP
, BUTTON_SELECT
|BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
315 { ACTION_USB_HID_MOUSE_LDRAG_LEFT
, BUTTON_SELECT
|BUTTON_LEFT
, BUTTON_NONE
},
316 { ACTION_USB_HID_MOUSE_LDRAG_LEFT_REP
, BUTTON_SELECT
|BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
317 { ACTION_USB_HID_MOUSE_LDRAG_RIGHT
, BUTTON_SELECT
|BUTTON_RIGHT
, BUTTON_NONE
},
318 { ACTION_USB_HID_MOUSE_LDRAG_RIGHT_REP
, BUTTON_SELECT
|BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
319 { ACTION_USB_HID_MOUSE_BUTTON_RIGHT
, BUTTON_POWER
, BUTTON_NONE
},
320 { ACTION_USB_HID_MOUSE_BUTTON_RIGHT_REL
, BUTTON_POWER
|BUTTON_REL
, BUTTON_NONE
},
321 { ACTION_USB_HID_MOUSE_RDRAG_UP
, BUTTON_POWER
|BUTTON_UP
, BUTTON_NONE
},
322 { ACTION_USB_HID_MOUSE_RDRAG_UP_REP
, BUTTON_POWER
|BUTTON_UP
|BUTTON_REPEAT
, BUTTON_NONE
},
323 { ACTION_USB_HID_MOUSE_RDRAG_DOWN
, BUTTON_POWER
|BUTTON_DOWN
, BUTTON_NONE
},
324 { ACTION_USB_HID_MOUSE_RDRAG_DOWN_REP
, BUTTON_POWER
|BUTTON_DOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
325 { ACTION_USB_HID_MOUSE_RDRAG_LEFT
, BUTTON_POWER
|BUTTON_LEFT
, BUTTON_NONE
},
326 { ACTION_USB_HID_MOUSE_RDRAG_LEFT_REP
, BUTTON_POWER
|BUTTON_LEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
327 { ACTION_USB_HID_MOUSE_RDRAG_RIGHT
, BUTTON_POWER
|BUTTON_RIGHT
, BUTTON_NONE
},
328 { ACTION_USB_HID_MOUSE_RDRAG_RIGHT_REP
, BUTTON_POWER
|BUTTON_RIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
329 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP
, BUTTON_VOLUP
, BUTTON_NONE
},
330 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP
, BUTTON_VOLUP
|BUTTON_REPEAT
, BUTTON_NONE
},
331 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN
, BUTTON_VOLDOWN
, BUTTON_NONE
},
332 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN
, BUTTON_VOLDOWN
|BUTTON_REPEAT
, BUTTON_NONE
},
334 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID
)
335 }; /* button_context_usb_hid_mode_mouse */
339 /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
340 const struct button_mapping
* get_context_mapping(int context
)
345 return button_context_standard
;
348 return button_context_wps
;
351 return button_context_list
;
353 case CONTEXT_MAINMENU
:
354 if (global_settings
.hold_lr_for_scroll_in_list
)
355 return button_context_listtree_scroll_without_combo
;
357 return button_context_listtree_scroll_with_combo
;
358 case CONTEXT_CUSTOM
|CONTEXT_TREE
:
359 return button_context_tree
;
361 case CONTEXT_SETTINGS
:
362 case CONTEXT_SETTINGS_TIME
:
363 return button_context_settings
;
364 case CONTEXT_CUSTOM
|CONTEXT_SETTINGS
:
365 case CONTEXT_SETTINGS_COLOURCHOOSER
:
366 case CONTEXT_SETTINGS_EQ
:
367 return button_context_settings_right_is_inc
;
369 case CONTEXT_YESNOSCREEN
:
370 return button_context_yesno
;
373 return button_context_radio
;
375 case CONTEXT_BOOKMARKSCREEN
:
376 return button_context_bmark
;
377 case CONTEXT_QUICKSCREEN
:
378 return button_context_quickscreen
;
379 case CONTEXT_PITCHSCREEN
:
380 return button_context_pitchscreen
;
381 #ifdef HAVE_RECORDING
382 case CONTEXT_RECSCREEN
:
383 return button_context_recscreen
;
385 case CONTEXT_KEYBOARD
:
386 return button_context_keyboard
;
387 #ifdef USB_ENABLE_HID
388 case CONTEXT_USB_HID
:
389 return button_context_usb_hid
;
390 case CONTEXT_USB_HID_MODE_MULTIMEDIA
:
391 return button_context_usb_hid_mode_multimedia
;
392 case CONTEXT_USB_HID_MODE_PRESENTATION
:
393 return button_context_usb_hid_mode_presentation
;
394 case CONTEXT_USB_HID_MODE_BROWSER
:
395 return button_context_usb_hid_mode_browser
;
396 #ifdef HAVE_USB_HID_MOUSE
397 case CONTEXT_USB_HID_MODE_MOUSE
:
398 return button_context_usb_hid_mode_mouse
;
402 return button_context_standard
;
404 return button_context_standard
;