1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2006 Jonathan Gordon
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 touchscreen targets */
32 const struct button_mapping
* target_get_context_mapping(int context
);
33 /* How this file is used:
34 get_context_mapping() at the bottom of the file is called by action.c as usual.
35 if the context is for the remote control its then passed straight to
36 target_get_context_mapping().
37 These tables are only used for the touchscreen buttons, so at the end of each
38 CONTEXT_CUSTOM2 is OR'ed with the context and then sent to target_get_context_mapping()
39 (NOTE: CONTEXT_CUSTOM2 will be stripped before being sent to make it easier.)
40 In the target keymap, remember to |CONTEXT_CUSTOM2 in the LAST_ITEM_IN_LIST__NEXTLIST() macro
41 to speed it up a tiny bit... if you dont it will go through these tables first before going
42 back to the target file.
46 /* touchscreen "buttons"
47 screen is split into a 3x3 grid for buttons...
48 BUTTON_TOPLEFT BUTTON_TOPMIDDLE BUTTON_TOPRIGHT
49 BUTTON_MIDLEFT BUTTON_CENTER BUTTON_MIDRIGHT
50 BUTTON_BOTTOMLEFT BUTTON_BOTTOMMIDDLE BUTTON_BOTTOMRIGHT
53 static const struct button_mapping button_context_standard
[] = {
54 { ACTION_STD_PREV
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
55 { ACTION_STD_PREVREPEAT
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
56 { ACTION_STD_NEXT
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
57 { ACTION_STD_NEXTREPEAT
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
59 { ACTION_STD_OK
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_CENTER
},
60 { ACTION_STD_OK
, BUTTON_MIDRIGHT
|BUTTON_REL
, BUTTON_MIDRIGHT
},
61 { ACTION_STD_CANCEL
, BUTTON_MIDLEFT
, BUTTON_NONE
},
62 { ACTION_STD_CANCEL
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
64 { ACTION_STD_MENU
, BUTTON_TOPLEFT
, BUTTON_NONE
},
65 { ACTION_STD_QUICKSCREEN
, BUTTON_BOTTOMLEFT
, BUTTON_NONE
},
66 { ACTION_STD_CONTEXT
, BUTTON_CENTER
|BUTTON_REPEAT
, BUTTON_CENTER
},
67 { ACTION_STD_CONTEXT
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_MIDRIGHT
},
69 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_STD
)
70 }; /* button_context_standard */
72 static const struct button_mapping button_context_wps
[] = {
74 { ACTION_WPS_PLAY
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_CENTER
},
75 { ACTION_WPS_STOP
, BUTTON_CENTER
|BUTTON_REPEAT
, BUTTON_CENTER
},
77 { ACTION_WPS_SKIPPREV
, BUTTON_MIDLEFT
|BUTTON_REL
, BUTTON_MIDLEFT
},
78 { ACTION_WPS_SEEKBACK
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
79 { ACTION_WPS_STOPSEEK
, BUTTON_MIDLEFT
|BUTTON_REL
, BUTTON_MIDLEFT
|BUTTON_REPEAT
},
81 { ACTION_WPS_SKIPNEXT
, BUTTON_MIDRIGHT
|BUTTON_REL
, BUTTON_MIDRIGHT
},
82 { ACTION_WPS_SEEKFWD
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
83 { ACTION_WPS_STOPSEEK
, BUTTON_MIDRIGHT
|BUTTON_REL
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
},
85 { ACTION_WPS_VOLUP
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
86 { ACTION_WPS_VOLUP
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
87 { ACTION_WPS_VOLDOWN
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
88 { ACTION_WPS_VOLDOWN
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
90 { ACTION_WPS_BROWSE
, BUTTON_TOPRIGHT
|BUTTON_REL
, BUTTON_TOPRIGHT
},
91 { ACTION_WPS_CONTEXT
, BUTTON_TOPRIGHT
|BUTTON_REPEAT
, BUTTON_TOPRIGHT
},
93 { ACTION_WPS_MENU
, BUTTON_TOPLEFT
|BUTTON_REL
, BUTTON_TOPLEFT
},
94 { ACTION_WPS_QUICKSCREEN
, BUTTON_BOTTOMLEFT
|BUTTON_REL
, BUTTON_BOTTOMLEFT
},
95 { ACTION_WPS_VIEW_PLAYLIST
, BUTTON_BOTTOMRIGHT
|BUTTON_REL
, BUTTON_BOTTOMRIGHT
},
96 { ACTION_WPS_REC
, BUTTON_TOPLEFT
|BUTTON_REPEAT
, BUTTON_TOPLEFT
},
97 { ACTION_WPS_PITCHSCREEN
, BUTTON_BOTTOMLEFT
|BUTTON_REPEAT
, BUTTON_BOTTOMLEFT
},
98 { ACTION_WPS_ID3SCREEN
, BUTTON_BOTTOMRIGHT
|BUTTON_REPEAT
, BUTTON_BOTTOMRIGHT
},
100 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_WPS
)
101 }; /* button_context_wps */
103 static const struct button_mapping button_context_list
[] = {
105 /* this is all to show how the poor-mans-gestures can be used... */
106 { ACTION_LISTTREE_PGUP
, BUTTON_TOPRIGHT
, BUTTON_NONE
},
107 { ACTION_LISTTREE_PGUP
, BUTTON_TOPRIGHT
|BUTTON_REPEAT
, BUTTON_TOPRIGHT
},
108 { ACTION_STD_NEXTREPEAT
, BUTTON_CENTER
, BUTTON_TOPMIDDLE
},
109 { ACTION_STD_NEXTREPEAT
, BUTTON_BOTTOMMIDDLE
, BUTTON_CENTER
},
110 { ACTION_NONE
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
111 { ACTION_NONE
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
112 { ACTION_STD_PREV
, BUTTON_TOPMIDDLE
|BUTTON_REL
, BUTTON_NONE
},
113 { ACTION_STD_NEXT
, BUTTON_BOTTOMMIDDLE
|BUTTON_REL
, BUTTON_NONE
},
114 { ACTION_LISTTREE_PGDOWN
, BUTTON_BOTTOMRIGHT
, BUTTON_NONE
},
115 { ACTION_LISTTREE_PGDOWN
, BUTTON_BOTTOMRIGHT
|BUTTON_REPEAT
, BUTTON_BOTTOMRIGHT
},
116 { ACTION_STD_PREVREPEAT
, BUTTON_TOPMIDDLE
, BUTTON_CENTER
},
117 { ACTION_STD_PREVREPEAT
, BUTTON_CENTER
, BUTTON_BOTTOMMIDDLE
},
119 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_LIST
)
120 }; /* button_context_list */
122 static const struct button_mapping button_context_tree
[] = {
123 { ACTION_TREE_WPS
, BUTTON_TOPRIGHT
|BUTTON_REL
, BUTTON_TOPRIGHT
},
124 { ACTION_TREE_STOP
, BUTTON_BOTTOMRIGHT
|BUTTON_REL
, BUTTON_BOTTOMRIGHT
},
126 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_CUSTOM
|CONTEXT_TREE
)
127 }; /* button_context_tree */
129 static const struct button_mapping button_context_listtree_scroll_with_combo
[] = {
130 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM
|CONTEXT_TREE
),
133 static const struct button_mapping button_context_listtree_scroll_without_combo
[] = {
134 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM
|CONTEXT_TREE
),
137 static const struct button_mapping button_context_settings
[] = {
138 { ACTION_SETTINGS_INC
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
139 { ACTION_SETTINGS_INCREPEAT
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
140 { ACTION_SETTINGS_DEC
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
141 { ACTION_SETTINGS_DECREPEAT
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
142 { ACTION_SETTINGS_RESET
, BUTTON_CENTER
, BUTTON_NONE
},
144 { ACTION_STD_PREV
, BUTTON_MIDLEFT
, BUTTON_NONE
},
145 { ACTION_STD_PREVREPEAT
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
146 { ACTION_STD_NEXT
, BUTTON_MIDRIGHT
, BUTTON_NONE
},
147 { ACTION_STD_NEXTREPEAT
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
148 { ACTION_STD_CANCEL
, BUTTON_TOPLEFT
, BUTTON_NONE
},
150 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_SETTINGS
)
151 }; /* button_context_settings */
153 static const struct button_mapping button_context_settings_right_is_inc
[] = {
154 { ACTION_NONE
, BUTTON_MIDRIGHT
|BUTTON_REL
, BUTTON_MIDRIGHT
},
155 { ACTION_NONE
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_MIDRIGHT
},
156 { ACTION_SETTINGS_INC
, BUTTON_MIDRIGHT
, BUTTON_NONE
},
157 { ACTION_SETTINGS_INCREPEAT
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
158 { ACTION_SETTINGS_DEC
, BUTTON_MIDLEFT
, BUTTON_NONE
},
159 { ACTION_SETTINGS_DECREPEAT
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
160 { ACTION_SETTINGS_RESET
, BUTTON_CENTER
, BUTTON_NONE
},
162 { ACTION_STD_CANCEL
, BUTTON_TOPLEFT
, BUTTON_NONE
},
164 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_CUSTOM
|CONTEXT_SETTINGS
)
165 }; /* button_context_settingsgraphical */
167 static const struct button_mapping button_context_yesno
[] = {
168 { ACTION_YESNO_ACCEPT
, BUTTON_TOPRIGHT
, BUTTON_NONE
},
169 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_YESNOSCREEN
)
170 }; /* button_context_settings_yesno */
172 static const struct button_mapping button_context_colorchooser
[] = {
173 { ACTION_STD_OK
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_NONE
},
174 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_SETTINGS_COLOURCHOOSER
),
175 }; /* button_context_colorchooser */
177 static const struct button_mapping button_context_eq
[] = {
178 /* override the std context since we're using MIDRIGHT for settings inc */
179 { ACTION_NONE
, BUTTON_MIDRIGHT
|BUTTON_REL
, BUTTON_MIDRIGHT
},
180 { ACTION_NONE
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_MIDRIGHT
},
181 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_SETTINGS_EQ
),
182 }; /* button_context_eq */
184 /* Bookmark Screen */
185 static const struct button_mapping button_context_bmark
[] = {
186 { ACTION_BMS_DELETE
, BUTTON_BOTTOMRIGHT
, BUTTON_NONE
},
188 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_BOOKMARKSCREEN
),
189 }; /* button_context_bmark */
191 static const struct button_mapping button_context_time
[] = {
192 { ACTION_SETTINGS_INC
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
193 { ACTION_SETTINGS_INCREPEAT
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
194 { ACTION_SETTINGS_DEC
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
195 { ACTION_SETTINGS_DECREPEAT
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
196 { ACTION_STD_PREV
, BUTTON_MIDLEFT
, BUTTON_NONE
},
197 { ACTION_STD_PREVREPEAT
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
198 { ACTION_STD_NEXT
, BUTTON_MIDRIGHT
, BUTTON_NONE
},
199 { ACTION_STD_NEXTREPEAT
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
200 { ACTION_STD_OK
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_CENTER
},
201 { ACTION_STD_CANCEL
, BUTTON_TOPLEFT
|BUTTON_REL
, BUTTON_TOPLEFT
},
202 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_SETTINGS_TIME
),
203 }; /* button_context_time */
205 static const struct button_mapping button_context_quickscreen
[] = {
206 /* override ACTION_STD_CANCEL from standard context */
207 { ACTION_NONE
, BUTTON_MIDLEFT
, BUTTON_NONE
},
209 { ACTION_STD_CANCEL
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_NONE
},
210 { ACTION_STD_CANCEL
, BUTTON_TOPLEFT
|BUTTON_REL
, BUTTON_NONE
},
211 { ACTION_STD_CANCEL
, BUTTON_TOPRIGHT
|BUTTON_REL
, BUTTON_NONE
},
212 { ACTION_STD_CANCEL
, BUTTON_BOTTOMLEFT
|BUTTON_REL
, BUTTON_NONE
},
213 { ACTION_STD_CANCEL
, BUTTON_BOTTOMRIGHT
|BUTTON_REL
, BUTTON_NONE
},
214 { ACTION_QS_TOP
, BUTTON_TOPMIDDLE
|BUTTON_REL
, BUTTON_NONE
},
215 { ACTION_QS_TOP
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
216 { ACTION_QS_DOWN
, BUTTON_BOTTOMMIDDLE
|BUTTON_REL
, BUTTON_NONE
},
217 { ACTION_QS_DOWN
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
218 { ACTION_QS_LEFT
, BUTTON_MIDLEFT
|BUTTON_REL
, BUTTON_NONE
},
219 { ACTION_QS_LEFT
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
220 { ACTION_QS_RIGHT
, BUTTON_MIDRIGHT
|BUTTON_REL
, BUTTON_NONE
},
221 { ACTION_QS_RIGHT
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
222 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_QUICKSCREEN
)
223 }; /* button_context_quickscreen */
225 static const struct button_mapping button_context_pitchscreen
[] = {
227 { ACTION_PS_INC_SMALL
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
228 { ACTION_PS_INC_BIG
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
229 { ACTION_PS_DEC_SMALL
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
230 { ACTION_PS_DEC_BIG
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
231 { ACTION_PS_NUDGE_LEFT
, BUTTON_MIDLEFT
, BUTTON_NONE
},
232 { ACTION_PS_NUDGE_LEFTOFF
, BUTTON_MIDLEFT
|BUTTON_REL
, BUTTON_NONE
},
233 { ACTION_PS_NUDGE_RIGHT
, BUTTON_MIDRIGHT
, BUTTON_NONE
},
234 { ACTION_PS_NUDGE_RIGHTOFF
, BUTTON_MIDRIGHT
|BUTTON_REL
, BUTTON_NONE
},
235 { ACTION_PS_TOGGLE_MODE
, BUTTON_TOPRIGHT
, BUTTON_NONE
},
236 { ACTION_PS_TOGGLE_MODE
, BUTTON_BOTTOMRIGHT
, BUTTON_NONE
},
237 { ACTION_PS_RESET
, BUTTON_CENTER
, BUTTON_NONE
},
238 { ACTION_PS_EXIT
, BUTTON_TOPLEFT
, BUTTON_NONE
},
239 { ACTION_PS_EXIT
, BUTTON_BOTTOMLEFT
, BUTTON_NONE
},
240 { ACTION_PS_SLOWER
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
241 { ACTION_PS_FASTER
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
242 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_PITCHSCREEN
)
243 }; /* button_context_pitchcreen */
245 static const struct button_mapping button_context_keyboard
[] = {
247 { ACTION_KBD_LEFT
, BUTTON_MIDLEFT
, BUTTON_NONE
},
248 { ACTION_KBD_LEFT
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
249 { ACTION_KBD_RIGHT
, BUTTON_MIDRIGHT
, BUTTON_NONE
},
250 { ACTION_KBD_RIGHT
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
251 { ACTION_KBD_CURSOR_LEFT
, BUTTON_TOPLEFT
, BUTTON_NONE
},
252 { ACTION_KBD_CURSOR_LEFT
, BUTTON_TOPLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
253 { ACTION_KBD_CURSOR_RIGHT
, BUTTON_TOPRIGHT
, BUTTON_NONE
},
254 { ACTION_KBD_CURSOR_RIGHT
, BUTTON_TOPRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
255 { ACTION_KBD_SELECT
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_NONE
},
256 { ACTION_KBD_DONE
, BUTTON_CENTER
|BUTTON_REPEAT
, BUTTON_CENTER
},
257 { ACTION_KBD_ABORT
, BUTTON_BOTTOMRIGHT
, BUTTON_NONE
},
258 { ACTION_KBD_BACKSPACE
, BUTTON_BOTTOMLEFT
, BUTTON_NONE
},
259 { ACTION_KBD_BACKSPACE
, BUTTON_BOTTOMLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
260 { ACTION_KBD_UP
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
261 { ACTION_KBD_UP
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
262 { ACTION_KBD_DOWN
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
263 { ACTION_KBD_DOWN
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
265 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_KEYBOARD
)
266 }; /* button_context_keyboard */
268 static const struct button_mapping button_context_radio
[] = {
269 { ACTION_STD_PREV
, BUTTON_MIDLEFT
, BUTTON_NONE
},
270 { ACTION_STD_PREVREPEAT
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
271 { ACTION_STD_NEXT
, BUTTON_MIDRIGHT
, BUTTON_NONE
},
272 { ACTION_STD_NEXTREPEAT
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
273 { ACTION_FM_MENU
, BUTTON_CENTER
|BUTTON_REPEAT
, BUTTON_CENTER
},
274 { ACTION_FM_PRESET
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_NONE
},
275 { ACTION_FM_STOP
, BUTTON_BOTTOMRIGHT
|BUTTON_REL
, BUTTON_NONE
},
276 { ACTION_FM_EXIT
, BUTTON_TOPLEFT
|BUTTON_REL
, BUTTON_NONE
},
277 { ACTION_FM_MODE
, BUTTON_BOTTOMLEFT
|BUTTON_REL
, BUTTON_NONE
},
278 { ACTION_FM_PLAY
, BUTTON_TOPRIGHT
|BUTTON_REL
, BUTTON_NONE
},
279 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2
|CONTEXT_FM
)
280 }; /* button_context_radio */
282 #ifdef USB_ENABLE_HID
283 static const struct button_mapping button_context_usb_hid
[] = {
284 { ACTION_USB_HID_MODE_SWITCH_NEXT
, BUTTON_TOPLEFT
|BUTTON_REL
, BUTTON_TOPLEFT
},
285 { ACTION_USB_HID_MODE_SWITCH_PREV
, BUTTON_TOPLEFT
|BUTTON_REPEAT
, BUTTON_TOPLEFT
},
288 }; /* button_context_usb_hid */
290 static const struct button_mapping button_context_usb_hid_mode_multimedia
[] = {
291 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
292 { ACTION_USB_HID_MULTIMEDIA_VOLUME_DOWN
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
293 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
294 { ACTION_USB_HID_MULTIMEDIA_VOLUME_UP
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
295 { ACTION_USB_HID_MULTIMEDIA_VOLUME_MUTE
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_CENTER
},
296 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_PLAY_PAUSE
, BUTTON_TOPRIGHT
|BUTTON_REL
, BUTTON_TOPRIGHT
},
297 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_STOP
, BUTTON_TOPRIGHT
|BUTTON_REPEAT
, BUTTON_TOPRIGHT
},
298 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_PREV
, BUTTON_BOTTOMLEFT
|BUTTON_REL
, BUTTON_BOTTOMLEFT
},
299 { ACTION_USB_HID_MULTIMEDIA_PLAYBACK_TRACK_NEXT
, BUTTON_BOTTOMRIGHT
|BUTTON_REL
, BUTTON_BOTTOMRIGHT
},
301 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID
)
302 }; /* button_context_usb_hid_mode_multimedia */
304 static const struct button_mapping button_context_usb_hid_mode_presentation
[] = {
305 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_START
, BUTTON_TOPRIGHT
|BUTTON_REL
, BUTTON_TOPRIGHT
},
306 { ACTION_USB_HID_PRESENTATION_SLIDESHOW_LEAVE
, BUTTON_TOPRIGHT
|BUTTON_REPEAT
, BUTTON_TOPRIGHT
},
307 { ACTION_USB_HID_PRESENTATION_SLIDE_PREV
, BUTTON_MIDLEFT
|BUTTON_REL
, BUTTON_MIDLEFT
},
308 { ACTION_USB_HID_PRESENTATION_SLIDE_NEXT
, BUTTON_MIDRIGHT
|BUTTON_REL
, BUTTON_MIDRIGHT
},
309 { ACTION_USB_HID_PRESENTATION_SLIDE_FIRST
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_MIDLEFT
},
310 { ACTION_USB_HID_PRESENTATION_SLIDE_LAST
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_MIDRIGHT
},
311 { ACTION_USB_HID_PRESENTATION_SCREEN_BLACK
, BUTTON_BOTTOMRIGHT
|BUTTON_REL
, BUTTON_BOTTOMRIGHT
},
312 { ACTION_USB_HID_PRESENTATION_SCREEN_WHITE
, BUTTON_BOTTOMRIGHT
|BUTTON_REPEAT
, BUTTON_BOTTOMRIGHT
},
313 { ACTION_USB_HID_PRESENTATION_LINK_PREV
, BUTTON_TOPMIDDLE
|BUTTON_REL
, BUTTON_TOPMIDDLE
},
314 { ACTION_USB_HID_PRESENTATION_LINK_PREV
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_TOPMIDDLE
},
315 { ACTION_USB_HID_PRESENTATION_LINK_NEXT
, BUTTON_BOTTOMMIDDLE
|BUTTON_REL
, BUTTON_BOTTOMMIDDLE
},
316 { ACTION_USB_HID_PRESENTATION_LINK_NEXT
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_BOTTOMMIDDLE
},
317 { ACTION_USB_HID_PRESENTATION_MOUSE_CLICK
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_CENTER
},
318 { ACTION_USB_HID_PRESENTATION_MOUSE_OVER
, BUTTON_CENTER
|BUTTON_REPEAT
, BUTTON_CENTER
},
320 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID
)
321 }; /* button_context_usb_hid_mode_presentation */
323 static const struct button_mapping button_context_usb_hid_mode_browser
[] = {
324 { ACTION_USB_HID_BROWSER_SCROLL_UP
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
325 { ACTION_USB_HID_BROWSER_SCROLL_UP
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
326 { ACTION_USB_HID_BROWSER_SCROLL_DOWN
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
327 { ACTION_USB_HID_BROWSER_SCROLL_DOWN
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
328 { ACTION_USB_HID_BROWSER_ZOOM_IN
, BUTTON_TOPRIGHT
|BUTTON_REPEAT
, BUTTON_TOPRIGHT
},
329 { ACTION_USB_HID_BROWSER_ZOOM_OUT
, BUTTON_BOTTOMRIGHT
|BUTTON_REPEAT
, BUTTON_BOTTOMRIGHT
},
330 { ACTION_USB_HID_BROWSER_ZOOM_RESET
, BUTTON_CENTER
|BUTTON_REPEAT
, BUTTON_CENTER
},
331 { ACTION_USB_HID_BROWSER_ZOOM_RESET
, BUTTON_TOPRIGHT
|BUTTON_BOTTOMRIGHT
|BUTTON_REPEAT
, BUTTON_TOPRIGHT
|BUTTON_BOTTOMRIGHT
},
332 { ACTION_USB_HID_BROWSER_TAB_PREV
, BUTTON_MIDLEFT
|BUTTON_REL
, BUTTON_MIDLEFT
},
333 { ACTION_USB_HID_BROWSER_TAB_NEXT
, BUTTON_MIDRIGHT
|BUTTON_REL
, BUTTON_MIDRIGHT
},
334 { ACTION_USB_HID_BROWSER_TAB_CLOSE
, BUTTON_BOTTOMLEFT
|BUTTON_REPEAT
, BUTTON_BOTTOMLEFT
},
335 { ACTION_USB_HID_BROWSER_HISTORY_BACK
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_MIDLEFT
},
336 { ACTION_USB_HID_BROWSER_HISTORY_FORWARD
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_MIDRIGHT
},
337 { ACTION_USB_HID_BROWSER_VIEW_FULL_SCREEN
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_CENTER
},
339 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID
)
340 }; /* button_context_usb_hid_mode_browser */
342 #ifdef HAVE_USB_HID_MOUSE
343 static const struct button_mapping button_context_usb_hid_mode_mouse
[] = {
344 { ACTION_USB_HID_MOUSE_UP
, BUTTON_TOPMIDDLE
, BUTTON_NONE
},
345 { ACTION_USB_HID_MOUSE_UP_REP
, BUTTON_TOPMIDDLE
|BUTTON_REPEAT
, BUTTON_NONE
},
346 { ACTION_USB_HID_MOUSE_DOWN
, BUTTON_BOTTOMMIDDLE
, BUTTON_NONE
},
347 { ACTION_USB_HID_MOUSE_DOWN_REP
, BUTTON_BOTTOMMIDDLE
|BUTTON_REPEAT
,BUTTON_NONE
},
348 { ACTION_USB_HID_MOUSE_LEFT
, BUTTON_MIDLEFT
, BUTTON_NONE
},
349 { ACTION_USB_HID_MOUSE_LEFT_REP
, BUTTON_MIDLEFT
|BUTTON_REPEAT
, BUTTON_NONE
},
350 { ACTION_USB_HID_MOUSE_RIGHT
, BUTTON_MIDRIGHT
, BUTTON_NONE
},
351 { ACTION_USB_HID_MOUSE_RIGHT_REP
, BUTTON_MIDRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
352 { ACTION_USB_HID_MOUSE_BUTTON_LEFT
, BUTTON_CENTER
, BUTTON_NONE
},
353 { ACTION_USB_HID_MOUSE_BUTTON_LEFT_REL
, BUTTON_CENTER
|BUTTON_REL
, BUTTON_NONE
},
354 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP
, BUTTON_TOPRIGHT
, BUTTON_NONE
},
355 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_UP
, BUTTON_TOPRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
356 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN
, BUTTON_BOTTOMRIGHT
, BUTTON_NONE
},
357 { ACTION_USB_HID_MOUSE_WHEEL_SCROLL_DOWN
, BUTTON_BOTTOMRIGHT
|BUTTON_REPEAT
, BUTTON_NONE
},
359 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_USB_HID
)
360 }; /* button_context_usb_hid_mode_mouse */
364 const struct button_mapping
* get_context_mapping(int context
)
366 if (context
& CONTEXT_CUSTOM2
367 #if BUTTON_REMOTE != 0
368 || context
& CONTEXT_REMOTE
372 return target_get_context_mapping(context
& ~CONTEXT_CUSTOM2
);
378 return button_context_standard
;
380 return button_context_wps
;
383 return button_context_list
;
384 case CONTEXT_MAINMENU
:
386 if (global_settings
.hold_lr_for_scroll_in_list
)
387 return button_context_listtree_scroll_without_combo
;
389 return button_context_listtree_scroll_with_combo
;
390 case CONTEXT_CUSTOM
|CONTEXT_TREE
:
391 return button_context_tree
;
393 case CONTEXT_SETTINGS
:
394 return button_context_settings
;
395 case CONTEXT_CUSTOM
|CONTEXT_SETTINGS
:
396 return button_context_settings_right_is_inc
;
398 case CONTEXT_SETTINGS_COLOURCHOOSER
:
399 return button_context_colorchooser
;
400 case CONTEXT_SETTINGS_EQ
:
401 return button_context_eq
;
403 case CONTEXT_SETTINGS_TIME
:
404 return button_context_time
;
406 case CONTEXT_YESNOSCREEN
:
407 return button_context_yesno
;
409 return button_context_radio
;
410 case CONTEXT_BOOKMARKSCREEN
:
411 return button_context_bmark
;
412 case CONTEXT_QUICKSCREEN
:
413 return button_context_quickscreen
;
414 case CONTEXT_PITCHSCREEN
:
415 return button_context_pitchscreen
;
416 case CONTEXT_KEYBOARD
:
417 return button_context_keyboard
;
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
;
433 return button_context_standard
;
435 return button_context_standard
;