diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/SOURCES | 2 | ||||
-rw-r--r-- | apps/keymaps/keymap-mini2440.c | 389 |
2 files changed, 391 insertions, 0 deletions
diff --git a/apps/SOURCES b/apps/SOURCES index 6ec1732881..6c0b12c88f 100644 --- a/apps/SOURCES +++ b/apps/SOURCES | |||
@@ -254,4 +254,6 @@ keymaps/keymap-ondavx777.c | |||
254 | keymaps/keymap-ondavx767.c | 254 | keymaps/keymap-ondavx767.c |
255 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | 255 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD |
256 | keymaps/keymap-yh8xx_yh9xx.c | 256 | keymaps/keymap-yh8xx_yh9xx.c |
257 | #elif CONFIG_KEYPAD == MINI2440_PAD | ||
258 | keymaps/keymap-mini2440.c | ||
257 | #endif | 259 | #endif |
diff --git a/apps/keymaps/keymap-mini2440.c b/apps/keymaps/keymap-mini2440.c new file mode 100644 index 0000000000..4291bdfb68 --- /dev/null +++ b/apps/keymaps/keymap-mini2440.c | |||
@@ -0,0 +1,389 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 Bob Cousins | ||
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 Mini2440 target | ||
23 | * based on Toshiba Gigabeat F keymap | ||
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 | |||
41 | /* CONTEXT_CUSTOM's used in this file... | ||
42 | |||
43 | CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions) | ||
44 | CONTEXT_CUSTOM|CONTEXT_SETTINGS = the direction keys for the eq/col picker screens | ||
45 | i.e where up/down is inc/dec | ||
46 | CONTEXT_SETTINGS = up/down is prev/next, l/r is inc/dec | ||
47 | |||
48 | */ | ||
49 | |||
50 | |||
51 | static const struct button_mapping button_context_standard[] = { | ||
52 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, | ||
53 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
54 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
55 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
56 | |||
57 | { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, | ||
58 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | ||
59 | |||
60 | { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT,BUTTON_SELECT }, | ||
61 | |||
62 | { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
63 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
64 | |||
65 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
66 | { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE }, | ||
67 | |||
68 | LAST_ITEM_IN_LIST | ||
69 | }; /* button_context_standard */ | ||
70 | |||
71 | |||
72 | static const struct button_mapping button_context_wps[] = { | ||
73 | { ACTION_WPS_PLAY, BUTTON_A|BUTTON_REL, BUTTON_A }, | ||
74 | { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
75 | |||
76 | { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
77 | { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
78 | |||
79 | { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
80 | { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
81 | { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, | ||
82 | { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, | ||
83 | |||
84 | { ACTION_WPS_ABSETB_NEXTDIR,BUTTON_A|BUTTON_RIGHT, BUTTON_NONE }, | ||
85 | { ACTION_WPS_ABSETA_PREVDIR,BUTTON_A|BUTTON_LEFT, BUTTON_NONE }, | ||
86 | { ACTION_WPS_ABRESET, BUTTON_A|BUTTON_SELECT, BUTTON_NONE }, | ||
87 | |||
88 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
89 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
90 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
91 | { ACTION_WPS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
92 | { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
93 | { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, | ||
94 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
95 | { ACTION_WPS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
96 | |||
97 | { ACTION_WPS_PITCHSCREEN, BUTTON_A|BUTTON_UP, BUTTON_A }, | ||
98 | { ACTION_WPS_VIEW_PLAYLIST, BUTTON_A|BUTTON_DOWN, BUTTON_NONE }, | ||
99 | |||
100 | { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU }, | ||
101 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
102 | { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
103 | |||
104 | { ACTION_WPS_ID3SCREEN, BUTTON_A|BUTTON_MENU, BUTTON_NONE }, | ||
105 | { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
106 | |||
107 | LAST_ITEM_IN_LIST | ||
108 | }; /* button_context_wps */ | ||
109 | |||
110 | static const struct button_mapping button_context_list[] = { | ||
111 | { ACTION_LISTTREE_PGUP, BUTTON_A|BUTTON_UP, BUTTON_A }, | ||
112 | { ACTION_LISTTREE_PGUP, BUTTON_UP|BUTTON_REL, BUTTON_A|BUTTON_UP }, | ||
113 | { ACTION_LISTTREE_PGUP, BUTTON_A|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
114 | { ACTION_LISTTREE_PGDOWN, BUTTON_A|BUTTON_DOWN, BUTTON_A }, | ||
115 | { ACTION_LISTTREE_PGDOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_A|BUTTON_DOWN }, | ||
116 | { ACTION_LISTTREE_PGDOWN, BUTTON_A|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
117 | #ifdef HAVE_VOLUME_IN_LIST | ||
118 | { ACTION_LIST_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
119 | { ACTION_LIST_VOLUP, BUTTON_VOL_UP, BUTTON_NONE }, | ||
120 | { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE }, | ||
121 | { ACTION_LIST_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
122 | #endif | ||
123 | |||
124 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
125 | }; /* button_context_list */ | ||
126 | |||
127 | static const struct button_mapping button_context_tree[] = { | ||
128 | { ACTION_TREE_WPS, BUTTON_A|BUTTON_REL, BUTTON_A }, | ||
129 | { ACTION_TREE_STOP, BUTTON_POWER, BUTTON_NONE }, | ||
130 | { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
131 | { ACTION_TREE_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, | ||
132 | |||
133 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST) | ||
134 | }; /* button_context_tree */ | ||
135 | |||
136 | static const struct button_mapping button_context_listtree_scroll_with_combo[] = { | ||
137 | { ACTION_NONE, BUTTON_A, BUTTON_NONE }, | ||
138 | { ACTION_TREE_PGLEFT, BUTTON_A|BUTTON_LEFT, BUTTON_A }, | ||
139 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_A|BUTTON_LEFT }, | ||
140 | { ACTION_TREE_PGLEFT, BUTTON_A|BUTTON_LEFT, BUTTON_LEFT|BUTTON_REL }, | ||
141 | { ACTION_TREE_ROOT_INIT, BUTTON_A|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_A|BUTTON_LEFT }, | ||
142 | { ACTION_TREE_PGLEFT, BUTTON_A|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
143 | { ACTION_TREE_PGRIGHT, BUTTON_A|BUTTON_RIGHT, BUTTON_A }, | ||
144 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_A|BUTTON_RIGHT }, | ||
145 | { ACTION_TREE_PGRIGHT, BUTTON_A|BUTTON_RIGHT, BUTTON_RIGHT|BUTTON_REL }, | ||
146 | { ACTION_TREE_PGRIGHT, BUTTON_A|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
147 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | ||
148 | }; | ||
149 | |||
150 | static const struct button_mapping button_context_listtree_scroll_without_combo[] = { | ||
151 | { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE }, | ||
152 | { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
153 | { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT }, | ||
154 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
155 | { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, | ||
156 | { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE }, | ||
157 | { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
158 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
159 | { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, | ||
160 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE), | ||
161 | }; | ||
162 | |||
163 | static const struct button_mapping button_context_settings[] = { | ||
164 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, | ||
165 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
166 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, | ||
167 | { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
168 | { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE }, | ||
169 | { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
170 | { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE }, | ||
171 | { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
172 | { ACTION_SETTINGS_RESET, BUTTON_A, BUTTON_NONE }, | ||
173 | |||
174 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
175 | }; /* button_context_settings */ | ||
176 | |||
177 | static const struct button_mapping button_context_settings_right_is_inc[] = { | ||
178 | { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE }, | ||
179 | { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
180 | { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE }, | ||
181 | { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
182 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, | ||
183 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
184 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
185 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
186 | { ACTION_SETTINGS_RESET, BUTTON_A, BUTTON_NONE }, | ||
187 | |||
188 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
189 | }; /* button_context_settingsgraphical */ | ||
190 | |||
191 | static const struct button_mapping button_context_yesno[] = { | ||
192 | { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE }, | ||
193 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
194 | }; /* button_context_settings_yesno */ | ||
195 | |||
196 | static const struct button_mapping button_context_colorchooser[] = { | ||
197 | { ACTION_STD_OK, BUTTON_A|BUTTON_REL, BUTTON_NONE }, | ||
198 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), | ||
199 | }; /* button_context_colorchooser */ | ||
200 | |||
201 | static const struct button_mapping button_context_eq[] = { | ||
202 | { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, | ||
203 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), | ||
204 | }; /* button_context_eq */ | ||
205 | |||
206 | /** Bookmark Screen **/ | ||
207 | static const struct button_mapping button_context_bmark[] = { | ||
208 | { ACTION_BMS_DELETE, BUTTON_A, BUTTON_NONE }, | ||
209 | |||
210 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), | ||
211 | }; /* button_context_bmark */ | ||
212 | |||
213 | static const struct button_mapping button_context_time[] = { | ||
214 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | ||
215 | { ACTION_STD_OK, BUTTON_A, BUTTON_NONE }, | ||
216 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS), | ||
217 | }; /* button_context_time */ | ||
218 | |||
219 | static const struct button_mapping button_context_quickscreen[] = { | ||
220 | { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE }, | ||
221 | { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
222 | { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
223 | { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
224 | { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
225 | { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
226 | { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
227 | { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
228 | { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE }, | ||
229 | |||
230 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
231 | }; /* button_context_quickscreen */ | ||
232 | |||
233 | static const struct button_mapping button_context_pitchscreen[] = { | ||
234 | { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, | ||
235 | { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
236 | { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, | ||
237 | { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
238 | { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
239 | { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE }, | ||
240 | { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
241 | { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE }, | ||
242 | { ACTION_PS_TOGGLE_MODE, BUTTON_MENU, BUTTON_NONE }, | ||
243 | { ACTION_PS_RESET, BUTTON_A, BUTTON_NONE }, | ||
244 | { ACTION_PS_EXIT, BUTTON_POWER, BUTTON_NONE }, | ||
245 | { ACTION_PS_SLOWER, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
246 | { ACTION_PS_FASTER, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
247 | |||
248 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
249 | }; /* button_context_pitchcreen */ | ||
250 | |||
251 | static const struct button_mapping button_context_keyboard[] = { | ||
252 | { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE }, | ||
253 | { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
254 | { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE }, | ||
255 | { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
256 | { ACTION_KBD_CURSOR_LEFT, BUTTON_A|BUTTON_LEFT, BUTTON_NONE }, | ||
257 | { ACTION_KBD_CURSOR_LEFT, BUTTON_A|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
258 | { ACTION_KBD_CURSOR_RIGHT, BUTTON_A|BUTTON_RIGHT, BUTTON_NONE }, | ||
259 | { ACTION_KBD_CURSOR_RIGHT, BUTTON_A|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
260 | { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE }, | ||
261 | { ACTION_KBD_PAGE_FLIP, BUTTON_A|BUTTON_MENU, BUTTON_NONE }, | ||
262 | { ACTION_KBD_DONE, BUTTON_A|BUTTON_REL, BUTTON_A }, | ||
263 | { ACTION_KBD_ABORT, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | ||
264 | { ACTION_KBD_BACKSPACE, BUTTON_MENU, BUTTON_NONE }, | ||
265 | { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | ||
266 | { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, | ||
267 | { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
268 | { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, | ||
269 | { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
270 | { ACTION_KBD_MORSE_INPUT, BUTTON_A|BUTTON_POWER, BUTTON_NONE }, | ||
271 | { ACTION_KBD_MORSE_SELECT, BUTTON_SELECT|BUTTON_REL, BUTTON_NONE }, | ||
272 | |||
273 | LAST_ITEM_IN_LIST | ||
274 | }; /* button_context_keyboard */ | ||
275 | |||
276 | #ifdef HAVE_MINI2440_REMOTE | ||
277 | /***************************************************************************** | ||
278 | * Remote control mappings | ||
279 | *****************************************************************************/ | ||
280 | |||
281 | static const struct button_mapping remote_button_context_standard[] = { | ||
282 | { ACTION_STD_PREV, BUTTON_RC_VOL_UP, BUTTON_NONE }, | ||
283 | { ACTION_STD_PREVREPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
284 | { ACTION_STD_NEXT, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, | ||
285 | { ACTION_STD_NEXTREPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
286 | { ACTION_STD_CANCEL, BUTTON_RC_REW, BUTTON_NONE }, | ||
287 | { ACTION_STD_OK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF }, | ||
288 | { ACTION_STD_CONTEXT, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_RC_FF }, | ||
289 | { ACTION_STD_MENU, BUTTON_RC_DSP, BUTTON_NONE }, | ||
290 | |||
291 | LAST_ITEM_IN_LIST | ||
292 | }; | ||
293 | |||
294 | static const struct button_mapping remote_button_context_wps[] = { | ||
295 | { ACTION_WPS_PLAY, BUTTON_RC_PLAY, BUTTON_NONE }, | ||
296 | |||
297 | { ACTION_WPS_SKIPNEXT, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF }, | ||
298 | { ACTION_WPS_SKIPPREV, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW }, | ||
299 | |||
300 | { ACTION_WPS_SEEKBACK, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, | ||
301 | { ACTION_WPS_SEEKFWD, BUTTON_RC_FF|BUTTON_REPEAT, BUTTON_NONE }, | ||
302 | { ACTION_WPS_STOPSEEK, BUTTON_RC_REW|BUTTON_REL, BUTTON_RC_REW|BUTTON_REPEAT }, | ||
303 | { ACTION_WPS_STOPSEEK, BUTTON_RC_FF|BUTTON_REL, BUTTON_RC_FF|BUTTON_REPEAT }, | ||
304 | |||
305 | { ACTION_WPS_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, | ||
306 | { ACTION_WPS_MENU, BUTTON_RC_DSP, BUTTON_NONE }, | ||
307 | |||
308 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE }, | ||
309 | { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
310 | { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
311 | { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE }, | ||
312 | |||
313 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
314 | }; | ||
315 | |||
316 | static const struct button_mapping remote_button_context_tree[] = { | ||
317 | { ACTION_TREE_WPS, BUTTON_RC_PLAY|BUTTON_REL, BUTTON_RC_PLAY }, | ||
318 | { ACTION_TREE_STOP, BUTTON_RC_PLAY|BUTTON_REPEAT, BUTTON_RC_PLAY }, | ||
319 | { ACTION_STD_CANCEL, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE }, | ||
320 | |||
321 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) | ||
322 | }; | ||
323 | |||
324 | static const struct button_mapping* get_context_mapping_remote( int context ) | ||
325 | { | ||
326 | context ^= CONTEXT_REMOTE; | ||
327 | |||
328 | switch (context) | ||
329 | { | ||
330 | case CONTEXT_WPS: | ||
331 | return remote_button_context_wps; | ||
332 | case CONTEXT_MAINMENU: | ||
333 | case CONTEXT_TREE: | ||
334 | return remote_button_context_tree; | ||
335 | } | ||
336 | return remote_button_context_standard; | ||
337 | } | ||
338 | #endif | ||
339 | |||
340 | const struct button_mapping* get_context_mapping(int context) | ||
341 | { | ||
342 | #ifdef HAVE_MINI2440_REMOTE | ||
343 | if (context&CONTEXT_REMOTE) | ||
344 | return get_context_mapping_remote(context); | ||
345 | #endif | ||
346 | switch (context) | ||
347 | { | ||
348 | case CONTEXT_STD: | ||
349 | return button_context_standard; | ||
350 | case CONTEXT_WPS: | ||
351 | return button_context_wps; | ||
352 | |||
353 | case CONTEXT_LIST: | ||
354 | return button_context_list; | ||
355 | case CONTEXT_MAINMENU: | ||
356 | case CONTEXT_TREE: | ||
357 | if (global_settings.hold_lr_for_scroll_in_list) | ||
358 | return button_context_listtree_scroll_without_combo; | ||
359 | else | ||
360 | return button_context_listtree_scroll_with_combo; | ||
361 | case CONTEXT_CUSTOM|CONTEXT_TREE: | ||
362 | return button_context_tree; | ||
363 | |||
364 | case CONTEXT_SETTINGS: | ||
365 | return button_context_settings; | ||
366 | case CONTEXT_CUSTOM|CONTEXT_SETTINGS: | ||
367 | return button_context_settings_right_is_inc; | ||
368 | |||
369 | case CONTEXT_SETTINGS_COLOURCHOOSER: | ||
370 | return button_context_colorchooser; | ||
371 | case CONTEXT_SETTINGS_EQ: | ||
372 | return button_context_eq; | ||
373 | |||
374 | case CONTEXT_SETTINGS_TIME: | ||
375 | return button_context_time; | ||
376 | |||
377 | case CONTEXT_YESNOSCREEN: | ||
378 | return button_context_yesno; | ||
379 | case CONTEXT_BOOKMARKSCREEN: | ||
380 | return button_context_bmark; | ||
381 | case CONTEXT_QUICKSCREEN: | ||
382 | return button_context_quickscreen; | ||
383 | case CONTEXT_PITCHSCREEN: | ||
384 | return button_context_pitchscreen; | ||
385 | case CONTEXT_KEYBOARD: | ||
386 | return button_context_keyboard; | ||
387 | } | ||
388 | return button_context_standard; | ||
389 | } | ||