summaryrefslogtreecommitdiff
path: root/apps/keymaps
diff options
context:
space:
mode:
Diffstat (limited to 'apps/keymaps')
-rw-r--r--apps/keymaps/keymap-logikdax.c319
1 files changed, 319 insertions, 0 deletions
diff --git a/apps/keymaps/keymap-logikdax.c b/apps/keymaps/keymap-logikdax.c
new file mode 100644
index 0000000000..fdf51e1652
--- /dev/null
+++ b/apps/keymaps/keymap-logikdax.c
@@ -0,0 +1,319 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2008 Dave Chapman
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/* Button Code Definitions for Sandisk c200 target */
22
23#include "config.h"
24#include "action.h"
25#include "button.h"
26#include "settings.h"
27
28/* {Action Code, Button code, Prereq button code } */
29
30/*
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
35 */
36static 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
40 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
41 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
42
43 { ACTION_STD_OK, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
44 { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
45 { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
46
47 { ACTION_STD_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
48 { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
49// { ACTION_STD_QUICKSCREEN, BUTTON_REC|BUTTON_SELECT, BUTTON_NONE },
50
51 LAST_ITEM_IN_LIST
52}; /* button_context_standard */
53
54
55static const struct button_mapping button_context_wps[] = {
56 { ACTION_WPS_PLAY, BUTTON_POWERPLAY|BUTTON_REL, BUTTON_POWERPLAY },
57 { ACTION_WPS_STOP, BUTTON_POWERPLAY|BUTTON_REPEAT, BUTTON_POWERPLAY },
58
59 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
60 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
61 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
62
63 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
64 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
65 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
66
67 { ACTION_WPS_ABSETB_NEXTDIR,BUTTON_MODE|BUTTON_RIGHT, BUTTON_MODE },
68 { ACTION_WPS_ABSETA_PREVDIR,BUTTON_MODE|BUTTON_LEFT, BUTTON_MODE },
69 { ACTION_WPS_ABRESET, BUTTON_MODE|BUTTON_UP, BUTTON_MODE },
70
71 { ACTION_WPS_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
72 { ACTION_WPS_BROWSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
73#if 0
74 { ACTION_WPS_PITCHSCREEN, BUTTON_SELECT|BUTTON_UP, BUTTON_SELECT },
75 { ACTION_WPS_ID3SCREEN, BUTTON_SELECT|BUTTON_DOWN, BUTTON_SELECT },
76 { ACTION_WPS_CONTEXT, BUTTON_VOLDOWN|BUTTON_REL, BUTTON_VOLDOWN },
77 { ACTION_WPS_QUICKSCREEN, BUTTON_VOLDOWN|BUTTON_REPEAT, BUTTON_VOLDOWN },
78#endif
79
80 LAST_ITEM_IN_LIST
81}; /* button_context_wps */
82
83static const struct button_mapping button_context_settings[] = {
84 { ACTION_STD_CANCEL, BUTTON_REC, BUTTON_NONE },
85 { ACTION_SETTINGS_RESET, BUTTON_SELECT, BUTTON_NONE },
86
87 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
88 { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
89
90 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
91 { ACTION_SETTINGS_DECREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
92
93 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
94 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
95
96 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
97 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
98
99 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
100}; /* button_context_settings */
101
102static const struct button_mapping button_context_list[] = {
103 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
104}; /* button_context_list */
105
106static const struct button_mapping button_context_tree[] = {
107 // { ACTION_TREE_WPS, BUTTON_REC|BUTTON_VOLUP, BUTTON_REC },
108 // { ACTION_TREE_STOP, BUTTON_REC|BUTTON_VOLUP|BUTTON_REPEAT, BUTTON_REC|BUTTON_VOLUP },
109
110 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
111}; /* button_context_tree */
112
113static const struct button_mapping button_context_listtree_scroll_without_combo[] = {
114 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
115 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
116 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
117 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
118 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
119
120 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
121 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
122 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
123 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
124
125 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
126}; /* button_context_listtree_scroll_without_combo */
127
128static const struct button_mapping button_context_listtree_scroll_with_combo[] = {
129 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
130
131// { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_REC },
132// { ACTION_TREE_PGLEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
133
134// { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_REC },
135// { ACTION_TREE_PGRIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
136
137 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
138}; /* button_context_listtree_scroll_with_combo */
139
140static const struct button_mapping button_context_yesno[] = {
141 { ACTION_YESNO_ACCEPT, BUTTON_SELECT, BUTTON_NONE },
142
143 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
144}; /* button_context_settings_yesno */
145
146static const struct button_mapping button_context_quickscreen[] = {
147 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
148 { ACTION_STD_CANCEL, BUTTON_MODE|BUTTON_REL, BUTTON_NONE },
149
150 { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REL, BUTTON_NONE },
151 { ACTION_QS_DOWNINV, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
152
153 { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REL, BUTTON_NONE },
154 { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
155
156 { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
157 { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
158
159 { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
160 { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
161
162 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
163}; /* button_context_quickscreen */
164
165static const struct button_mapping button_context_settings_right_is_inc[] = {
166 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
167 { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
168
169 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
170 { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
171
172 { ACTION_STD_CANCEL, BUTTON_MODE, BUTTON_NONE },
173
174 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
175}; /* button_context_settings_right_is_inc */
176
177static const struct button_mapping button_context_pitchscreen[] = {
178 { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
179 { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
180
181 { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
182 { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
183
184 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
185 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
186
187 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
188 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
189
190 { ACTION_PS_RESET, BUTTON_SELECT, BUTTON_NONE },
191 { ACTION_PS_EXIT, BUTTON_MODE, BUTTON_NONE },
192
193 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD),
194}; /* button_context_pitchscreen */
195
196/** Recording Screen **/
197#ifdef HAVE_RECORDING
198static const struct button_mapping button_context_recscreen[] = {
199 { ACTION_STD_MENU, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
200 { ACTION_REC_PAUSE, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT },
201 { ACTION_STD_CANCEL, BUTTON_MODE|BUTTON_REPEAT, BUTTON_NONE },
202 { ACTION_REC_NEWFILE, BUTTON_REC|BUTTON_REL, BUTTON_REC },
203
204 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
205 { ACTION_SETTINGS_INCREPEAT,BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
206 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
207 { ACTION_SETTINGS_DECREPEAT,BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
208
209 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
210}; /* button_context_recscreen */
211#endif
212
213/** FM Radio Screen **/
214#if CONFIG_TUNER
215static const struct button_mapping button_context_radio[] = {
216 { ACTION_NONE, BUTTON_UP, BUTTON_NONE },
217 { ACTION_FM_MENU, BUTTON_DOWN, BUTTON_NONE },
218 { ACTION_FM_PRESET, BUTTON_SELECT, BUTTON_NONE },
219 { ACTION_FM_STOP, BUTTON_POWERPLAY|BUTTON_REPEAT, BUTTON_POWERPLAY },
220 { ACTION_FM_MODE, BUTTON_REC, BUTTON_NONE },
221 { ACTION_FM_EXIT, BUTTON_MODE|BUTTON_REL, BUTTON_MODE },
222 { ACTION_FM_PLAY, BUTTON_POWERPLAY|BUTTON_REL, BUTTON_POWERPLAY },
223 { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
224 { ACTION_SETTINGS_INCREPEAT,BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
225 { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
226 { ACTION_SETTINGS_DECREPEAT,BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
227
228 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
229}; /* button_context_radio */
230#endif
231
232static const struct button_mapping button_context_keyboard[] = {
233 { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
234 { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
235 { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
236 { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
237
238// { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT, BUTTON_NONE },
239// { ACTION_KBD_CURSOR_LEFT, BUTTON_REC|BUTTON_LEFT|BUTTON_REPEAT,BUTTON_NONE },
240// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT, BUTTON_NONE },
241// { ACTION_KBD_CURSOR_RIGHT, BUTTON_REC|BUTTON_RIGHT|BUTTON_REPEAT,BUTTON_NONE },
242
243 { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
244 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
245 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
246 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
247
248// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN, BUTTON_NONE },
249// { ACTION_KBD_BACKSPACE, BUTTON_REC|BUTTON_VOLDOWN|BUTTON_REPEAT,BUTTON_NONE },
250
251// { ACTION_KBD_PAGE_FLIP, BUTTON_REC|BUTTON_SELECT, BUTTON_REC },
252
253 { ACTION_KBD_SELECT, BUTTON_SELECT, BUTTON_NONE },
254 { ACTION_KBD_DONE, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT },
255 { ACTION_KBD_ABORT, BUTTON_MODE, BUTTON_NONE },
256
257 LAST_ITEM_IN_LIST
258}; /* button_context_keyboard */
259
260static const struct button_mapping button_context_bmark[] = {
261// { ACTION_BMS_DELETE, BUTTON_REC, BUTTON_NONE },
262
263 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
264}; /* button_context_bmark */
265
266/* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */
267const struct button_mapping* get_context_mapping(int context)
268{
269 switch (context)
270 {
271 case CONTEXT_STD:
272 return button_context_standard;
273
274 case CONTEXT_WPS:
275 return button_context_wps;
276
277 case CONTEXT_LIST:
278 return button_context_list;
279 case CONTEXT_TREE:
280 case CONTEXT_MAINMENU:
281 if (global_settings.hold_lr_for_scroll_in_list)
282 return button_context_listtree_scroll_without_combo;
283 else
284 return button_context_listtree_scroll_with_combo;
285 case CONTEXT_CUSTOM|CONTEXT_TREE:
286 return button_context_tree;
287
288 case CONTEXT_SETTINGS:
289 case CONTEXT_SETTINGS_TIME:
290 return button_context_settings;
291 case CONTEXT_CUSTOM|CONTEXT_SETTINGS:
292 case CONTEXT_SETTINGS_COLOURCHOOSER:
293 case CONTEXT_SETTINGS_EQ:
294 return button_context_settings_right_is_inc;
295
296 case CONTEXT_YESNOSCREEN:
297 return button_context_yesno;
298#if CONFIG_TUNER
299 case CONTEXT_FM:
300 return button_context_radio;
301#endif
302 case CONTEXT_BOOKMARKSCREEN:
303 return button_context_bmark;
304 case CONTEXT_QUICKSCREEN:
305 return button_context_quickscreen;
306 case CONTEXT_PITCHSCREEN:
307 return button_context_pitchscreen;
308#ifdef HAVE_RECORDING
309 case CONTEXT_RECSCREEN:
310 return button_context_recscreen;
311#endif
312 case CONTEXT_KEYBOARD:
313 return button_context_keyboard;
314
315 default:
316 return button_context_standard;
317 }
318 return button_context_standard;
319}