diff options
Diffstat (limited to 'apps/keymaps')
-rw-r--r-- | apps/keymaps/keymap-cowond2.c | 30 | ||||
-rwxr-xr-x | apps/keymaps/keymap-mr500.c | 5 | ||||
-rw-r--r-- | apps/keymaps/keymap-touchpad.c | 214 |
3 files changed, 218 insertions, 31 deletions
diff --git a/apps/keymaps/keymap-cowond2.c b/apps/keymaps/keymap-cowond2.c index ff4fdc5417..59ca7cb123 100644 --- a/apps/keymaps/keymap-cowond2.c +++ b/apps/keymaps/keymap-cowond2.c | |||
@@ -37,48 +37,27 @@ | |||
37 | */ | 37 | */ |
38 | 38 | ||
39 | static const struct button_mapping button_context_standard[] = { | 39 | static const struct button_mapping button_context_standard[] = { |
40 | { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE }, | ||
41 | { ACTION_STD_PREV, BUTTON_MINUS, BUTTON_NONE }, | 40 | { ACTION_STD_PREV, BUTTON_MINUS, BUTTON_NONE }, |
42 | { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
43 | { ACTION_STD_PREVREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, | 41 | { ACTION_STD_PREVREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, |
44 | { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE }, | ||
45 | { ACTION_STD_NEXT, BUTTON_PLUS, BUTTON_NONE }, | 42 | { ACTION_STD_NEXT, BUTTON_PLUS, BUTTON_NONE }, |
46 | { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
47 | { ACTION_STD_NEXTREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, | 43 | { ACTION_STD_NEXTREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, |
48 | 44 | ||
49 | { ACTION_STD_OK, BUTTON_MENU|BUTTON_REL, BUTTON_NONE }, | 45 | { ACTION_STD_OK, BUTTON_MENU|BUTTON_REL, BUTTON_NONE }, |
50 | { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
51 | |||
52 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | 46 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, |
53 | // { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | 47 | // { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, |
54 | { ACTION_STD_CONTEXT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, | 48 | { ACTION_STD_CONTEXT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, |
55 | { ACTION_STD_CONTEXT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
56 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | 49 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, |
57 | { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE }, | ||
58 | { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
59 | LAST_ITEM_IN_LIST | 50 | LAST_ITEM_IN_LIST |
60 | }; /* button_context_standard */ | 51 | }; /* button_context_standard */ |
61 | 52 | ||
62 | 53 | ||
63 | static const struct button_mapping button_context_wps[] = { | 54 | static const struct button_mapping button_context_wps[] = { |
64 | { ACTION_WPS_PLAY, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | ||
65 | { ACTION_WPS_STOP, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | ||
66 | { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT }, | ||
67 | { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
68 | { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT }, | ||
69 | { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT }, | ||
70 | { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
71 | { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, | ||
72 | 55 | ||
73 | { ACTION_WPS_VOLDOWN, BUTTON_MINUS, BUTTON_NONE }, | 56 | { ACTION_WPS_VOLDOWN, BUTTON_MINUS, BUTTON_NONE }, |
74 | { ACTION_WPS_VOLDOWN, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, | 57 | { ACTION_WPS_VOLDOWN, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, |
75 | { ACTION_WPS_VOLUP, BUTTON_PLUS, BUTTON_NONE }, | 58 | { ACTION_WPS_VOLUP, BUTTON_PLUS, BUTTON_NONE }, |
76 | { ACTION_WPS_VOLUP, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, | 59 | { ACTION_WPS_VOLUP, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, |
77 | |||
78 | { ACTION_WPS_BROWSE, BUTTON_UP|BUTTON_REL, BUTTON_UP }, | ||
79 | { ACTION_WPS_CONTEXT, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP }, | ||
80 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | 60 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, |
81 | { ACTION_WPS_QUICKSCREEN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_DOWN }, | ||
82 | LAST_ITEM_IN_LIST | 61 | LAST_ITEM_IN_LIST |
83 | }; /* button_context_wps */ | 62 | }; /* button_context_wps */ |
84 | 63 | ||
@@ -99,13 +78,9 @@ static const struct button_mapping button_context_listtree_scroll_without_combo[ | |||
99 | }; | 78 | }; |
100 | 79 | ||
101 | static const struct button_mapping button_context_settings[] = { | 80 | static const struct button_mapping button_context_settings[] = { |
102 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, | ||
103 | { ACTION_SETTINGS_INC, BUTTON_PLUS, BUTTON_NONE }, | 81 | { ACTION_SETTINGS_INC, BUTTON_PLUS, BUTTON_NONE }, |
104 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | ||
105 | { ACTION_SETTINGS_INCREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, | 82 | { ACTION_SETTINGS_INCREPEAT, BUTTON_PLUS|BUTTON_REPEAT, BUTTON_NONE }, |
106 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, | ||
107 | { ACTION_SETTINGS_DEC, BUTTON_MINUS, BUTTON_NONE }, | 83 | { ACTION_SETTINGS_DEC, BUTTON_MINUS, BUTTON_NONE }, |
108 | { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | ||
109 | { ACTION_SETTINGS_DECREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, | 84 | { ACTION_SETTINGS_DECREPEAT, BUTTON_MINUS|BUTTON_REPEAT, BUTTON_NONE }, |
110 | { ACTION_STD_OK, BUTTON_MENU, BUTTON_NONE }, | 85 | { ACTION_STD_OK, BUTTON_MENU, BUTTON_NONE }, |
111 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, | 86 | { ACTION_STD_CANCEL, BUTTON_POWER, BUTTON_NONE }, |
@@ -154,10 +129,9 @@ static const struct button_mapping button_context_keyboard[] = { | |||
154 | //LAST_ITEM_IN_LIST | 129 | //LAST_ITEM_IN_LIST |
155 | }; /* button_context_keyboard */ | 130 | }; /* button_context_keyboard */ |
156 | 131 | ||
157 | extern int current_tick; | 132 | const struct button_mapping* target_get_context_mapping(int context) |
158 | const struct button_mapping* get_context_mapping(int context) | ||
159 | { | 133 | { |
160 | switch (context&(~CONTEXT_REMOTE)) | 134 | switch (context) |
161 | { | 135 | { |
162 | case CONTEXT_STD: | 136 | case CONTEXT_STD: |
163 | return button_context_standard; | 137 | return button_context_standard; |
diff --git a/apps/keymaps/keymap-mr500.c b/apps/keymaps/keymap-mr500.c index b0d75c15bf..c680929efd 100755 --- a/apps/keymaps/keymap-mr500.c +++ b/apps/keymaps/keymap-mr500.c | |||
@@ -17,7 +17,7 @@ | |||
17 | * | 17 | * |
18 | ****************************************************************************/ | 18 | ****************************************************************************/ |
19 | 19 | ||
20 | /* Button Code Definitions for the toshiba gigabeat target */ | 20 | /* Button Code Definitions for the Olympus M:robe 500 target */ |
21 | #include <stdio.h> | 21 | #include <stdio.h> |
22 | #include <string.h> | 22 | #include <string.h> |
23 | #include <stdlib.h> | 23 | #include <stdlib.h> |
@@ -137,8 +137,7 @@ static const struct button_mapping button_context_keyboard[] = { | |||
137 | LAST_ITEM_IN_LIST | 137 | LAST_ITEM_IN_LIST |
138 | }; /* button_context_keyboard */ | 138 | }; /* button_context_keyboard */ |
139 | 139 | ||
140 | extern int current_tick; | 140 | const struct button_mapping* target_get_context_mapping(int context) |
141 | const struct button_mapping* get_context_mapping(int context) | ||
142 | { | 141 | { |
143 | switch (context&(~CONTEXT_REMOTE)) | 142 | switch (context&(~CONTEXT_REMOTE)) |
144 | { | 143 | { |
diff --git a/apps/keymaps/keymap-touchpad.c b/apps/keymaps/keymap-touchpad.c new file mode 100644 index 0000000000..48f1103cd3 --- /dev/null +++ b/apps/keymaps/keymap-touchpad.c | |||
@@ -0,0 +1,214 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id: keymap-mr500.c 16056 2008-01-11 21:48:01Z roolku $ | ||
9 | * | ||
10 | * Copyright (C) 2006 Jonathan Gordon | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | /* Button Code Definitions for touchpad targets */ | ||
21 | #include <stdio.h> | ||
22 | #include <string.h> | ||
23 | #include <stdlib.h> | ||
24 | |||
25 | #include "config.h" | ||
26 | #include "action.h" | ||
27 | #include "button.h" | ||
28 | #include "settings.h" | ||
29 | |||
30 | const struct button_mapping* target_get_context_mapping(int context); | ||
31 | /* How this file is used: | ||
32 | get_context_mapping() at the bottom of the file is called by action.c as usual. | ||
33 | if the context is for the remote control its then passed straight to | ||
34 | target_get_context_mapping(). | ||
35 | These tables are only used for the touchpad buttons, so at the end of each | ||
36 | CONTEXT_CUSTOM2 is OR'ed with the context and then sent to target_get_context_mapping() | ||
37 | (NOTE: CONTEXT_CUSTOM2 will be stripped before being sent to make it easier.) | ||
38 | In the target keymap, remember to |CONTEXT_CUSTOM2 in the LAST_ITEM_IN_LIST__NEXTLIST() macro | ||
39 | to speed it up a tiny bit... if you dont it will go through these tables first before going | ||
40 | back to the target file. | ||
41 | */ | ||
42 | |||
43 | |||
44 | /* touchpad "buttons" | ||
45 | screen is split into a 3x3 grid for buttons... | ||
46 | BUTTON_TOPLEFT BUTTON_TOPMIDDLE BUTTON_TOPRIGHT | ||
47 | BUTTON_MIDLEFT BUTTON_CENTER BUTTON_MIDRIGHT | ||
48 | BUTTON_BOTTOMLEFT BUTTON_BOTTOMMIDDLE BUTTON_BOTTOMRIGHT | ||
49 | */ | ||
50 | |||
51 | static const struct button_mapping button_context_standard[] = { | ||
52 | { ACTION_STD_PREV, BUTTON_TOPMIDDLE, BUTTON_NONE }, | ||
53 | { ACTION_STD_PREVREPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, | ||
54 | { ACTION_STD_NEXT, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, | ||
55 | { ACTION_STD_NEXTREPEAT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, | ||
56 | |||
57 | { ACTION_STD_OK, BUTTON_CENTER|BUTTON_REL, BUTTON_CENTER }, | ||
58 | { ACTION_STD_OK, BUTTON_MIDRIGHT|BUTTON_REL, BUTTON_MIDRIGHT }, | ||
59 | { ACTION_STD_OK, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_MIDRIGHT }, | ||
60 | |||
61 | { ACTION_STD_MENU, BUTTON_TOPLEFT, BUTTON_NONE }, | ||
62 | { ACTION_STD_QUICKSCREEN, BUTTON_TOPLEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
63 | { ACTION_STD_CONTEXT, BUTTON_CENTER|BUTTON_REPEAT, BUTTON_CENTER }, | ||
64 | { ACTION_STD_CANCEL, BUTTON_MIDLEFT, BUTTON_NONE }, | ||
65 | { ACTION_STD_CANCEL, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
66 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_STD) | ||
67 | }; /* button_context_standard */ | ||
68 | |||
69 | static const struct button_mapping button_context_wps[] = { | ||
70 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_WPS) | ||
71 | }; /* button_context_wps */ | ||
72 | |||
73 | static const struct button_mapping button_context_list[] = { | ||
74 | #if 0 | ||
75 | /* this is all to show how the poor-mans-gestures can be used... */ | ||
76 | { ACTION_LISTTREE_PGUP, BUTTON_TOPRIGHT, BUTTON_NONE}, | ||
77 | { ACTION_LISTTREE_PGUP, BUTTON_TOPRIGHT|BUTTON_REPEAT, BUTTON_TOPRIGHT}, | ||
78 | { ACTION_STD_NEXTREPEAT, BUTTON_CENTER, BUTTON_TOPMIDDLE}, | ||
79 | { ACTION_STD_NEXTREPEAT, BUTTON_BOTTOMMIDDLE, BUTTON_CENTER}, | ||
80 | { ACTION_NONE, BUTTON_TOPMIDDLE, BUTTON_NONE }, | ||
81 | { ACTION_NONE, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, | ||
82 | { ACTION_STD_PREV, BUTTON_TOPMIDDLE|BUTTON_REL, BUTTON_NONE }, | ||
83 | { ACTION_STD_NEXT, BUTTON_BOTTOMMIDDLE|BUTTON_REL, BUTTON_NONE }, | ||
84 | { ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT, BUTTON_NONE}, | ||
85 | { ACTION_LISTTREE_PGDOWN, BUTTON_BOTTOMRIGHT|BUTTON_REPEAT, BUTTON_BOTTOMRIGHT}, | ||
86 | { ACTION_STD_PREVREPEAT, BUTTON_TOPMIDDLE, BUTTON_CENTER}, | ||
87 | { ACTION_STD_PREVREPEAT, BUTTON_CENTER, BUTTON_BOTTOMMIDDLE}, | ||
88 | #endif | ||
89 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_LIST) | ||
90 | }; /* button_context_list */ | ||
91 | |||
92 | static const struct button_mapping button_context_tree[] = { | ||
93 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM2|CONTEXT_TREE) | ||
94 | }; /* button_context_tree */ | ||
95 | |||
96 | static const struct button_mapping button_context_listtree_scroll_with_combo[] = { | ||
97 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM|CONTEXT_TREE), | ||
98 | }; | ||
99 | |||
100 | static const struct button_mapping button_context_listtree_scroll_without_combo[] = { | ||
101 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM|CONTEXT_TREE), | ||
102 | }; | ||
103 | |||
104 | static const struct button_mapping button_context_settings[] = { | ||
105 | { ACTION_SETTINGS_INC, BUTTON_TOPMIDDLE, BUTTON_NONE }, | ||
106 | { ACTION_SETTINGS_INCREPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, | ||
107 | { ACTION_SETTINGS_DEC, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, | ||
108 | { ACTION_SETTINGS_DECREPEAT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, | ||
109 | { ACTION_STD_OK, BUTTON_CENTER, BUTTON_NONE }, | ||
110 | { ACTION_STD_CANCEL, BUTTON_MIDLEFT, BUTTON_NONE }, | ||
111 | |||
112 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS) | ||
113 | }; /* button_context_settings */ | ||
114 | |||
115 | static const struct button_mapping button_context_settings_right_is_inc[] = { | ||
116 | { ACTION_STD_PREV, BUTTON_TOPMIDDLE, BUTTON_NONE }, | ||
117 | { ACTION_STD_PREVREPEAT, BUTTON_TOPMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, | ||
118 | { ACTION_STD_NEXT, BUTTON_BOTTOMMIDDLE, BUTTON_NONE }, | ||
119 | { ACTION_STD_NEXTREPEAT, BUTTON_BOTTOMMIDDLE|BUTTON_REPEAT, BUTTON_NONE }, | ||
120 | { ACTION_SETTINGS_INC, BUTTON_MIDRIGHT, BUTTON_NONE }, | ||
121 | { ACTION_SETTINGS_INCREPEAT, BUTTON_MIDRIGHT|BUTTON_REPEAT, BUTTON_NONE }, | ||
122 | { ACTION_SETTINGS_DEC, BUTTON_MIDLEFT, BUTTON_NONE }, | ||
123 | { ACTION_SETTINGS_DECREPEAT, BUTTON_MIDLEFT|BUTTON_REPEAT, BUTTON_NONE }, | ||
124 | { ACTION_STD_OK, BUTTON_CENTER, BUTTON_NONE }, | ||
125 | { ACTION_STD_CANCEL, BUTTON_TOPLEFT, BUTTON_NONE }, | ||
126 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_CUSTOM|CONTEXT_SETTINGS) | ||
127 | }; /* button_context_settingsgraphical */ | ||
128 | |||
129 | static const struct button_mapping button_context_yesno[] = { | ||
130 | { ACTION_YESNO_ACCEPT, BUTTON_MIDLEFT, BUTTON_NONE }, | ||
131 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_YESNOSCREEN) | ||
132 | }; /* button_context_settings_yesno */ | ||
133 | |||
134 | static const struct button_mapping button_context_colorchooser[] = { | ||
135 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS_COLOURCHOOSER), | ||
136 | }; /* button_context_colorchooser */ | ||
137 | |||
138 | static const struct button_mapping button_context_eq[] = { | ||
139 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS_EQ), | ||
140 | }; /* button_context_eq */ | ||
141 | |||
142 | /* Bookmark Screen */ | ||
143 | static const struct button_mapping button_context_bmark[] = { | ||
144 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_BOOKMARKSCREEN), | ||
145 | }; /* button_context_bmark */ | ||
146 | |||
147 | static const struct button_mapping button_context_time[] = { | ||
148 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_SETTINGS_TIME), | ||
149 | }; /* button_context_time */ | ||
150 | |||
151 | static const struct button_mapping button_context_quickscreen[] = { | ||
152 | |||
153 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_QUICKSCREEN) | ||
154 | }; /* button_context_quickscreen */ | ||
155 | |||
156 | static const struct button_mapping button_context_pitchscreen[] = { | ||
157 | |||
158 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_PITCHSCREEN) | ||
159 | }; /* button_context_pitchcreen */ | ||
160 | |||
161 | static const struct button_mapping button_context_keyboard[] = { | ||
162 | |||
163 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM2|CONTEXT_KEYBOARD) | ||
164 | }; /* button_context_keyboard */ | ||
165 | |||
166 | const struct button_mapping* get_context_mapping(int context) | ||
167 | { | ||
168 | if ((context&CONTEXT_REMOTE) || (context&CONTEXT_CUSTOM2)) | ||
169 | return target_get_context_mapping(context&(~CONTEXT_CUSTOM2)); | ||
170 | |||
171 | switch (context) | ||
172 | { | ||
173 | case CONTEXT_STD: | ||
174 | return button_context_standard; | ||
175 | case CONTEXT_WPS: | ||
176 | return button_context_wps; | ||
177 | |||
178 | case CONTEXT_LIST: | ||
179 | return button_context_list; | ||
180 | case CONTEXT_MAINMENU: | ||
181 | case CONTEXT_TREE: | ||
182 | if (global_settings.hold_lr_for_scroll_in_list) | ||
183 | return button_context_listtree_scroll_without_combo; | ||
184 | else | ||
185 | return button_context_listtree_scroll_with_combo; | ||
186 | case CONTEXT_CUSTOM|CONTEXT_TREE: | ||
187 | return button_context_tree; | ||
188 | |||
189 | case CONTEXT_SETTINGS: | ||
190 | return button_context_settings; | ||
191 | case CONTEXT_CUSTOM|CONTEXT_SETTINGS: | ||
192 | return button_context_settings_right_is_inc; | ||
193 | |||
194 | case CONTEXT_SETTINGS_COLOURCHOOSER: | ||
195 | return button_context_colorchooser; | ||
196 | case CONTEXT_SETTINGS_EQ: | ||
197 | return button_context_eq; | ||
198 | |||
199 | case CONTEXT_SETTINGS_TIME: | ||
200 | return button_context_time; | ||
201 | |||
202 | case CONTEXT_YESNOSCREEN: | ||
203 | return button_context_yesno; | ||
204 | case CONTEXT_BOOKMARKSCREEN: | ||
205 | return button_context_bmark; | ||
206 | case CONTEXT_QUICKSCREEN: | ||
207 | return button_context_quickscreen; | ||
208 | case CONTEXT_PITCHSCREEN: | ||
209 | return button_context_pitchscreen; | ||
210 | case CONTEXT_KEYBOARD: | ||
211 | return button_context_keyboard; | ||
212 | } | ||
213 | return button_context_standard; | ||
214 | } | ||