diff options
author | Johannes Rauh <johnbthetenth@gmail.com> | 2017-08-14 13:05:32 +0200 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2017-09-20 21:22:24 +0200 |
commit | 638eaeb88405ffa125db090015610199625d15b8 (patch) | |
tree | 2a2c389c640967476c2543d025d94d342baa9428 | |
parent | c1097cc847167d8d5ce66ab422829c491c8d8d12 (diff) | |
download | rockbox-638eaeb88405ffa125db090015610199625d15b8.tar.gz rockbox-638eaeb88405ffa125db090015610199625d15b8.zip |
Fix keymap for YP-R0 regarding broken keylock, add more key maps
Keylock is now toggled by the key combo User&Power for WPS and FMS.
Pitchscreen has been added as long press of User.
While in bookmark screen, short press of Power deletes bookmark.
While in (most) menus or tree, first press of MENU takes you back to the
main menu, second press to WPS (aka button_context_tree).
Removed ACTION_WPSAB_SINGLE as long press of USER is now Pitchscreen.
Change-Id: I6aee7f8655b1073ed8d74dabe73895a7c0e54bfe
-rw-r--r-- | apps/keymaps/keymap-ypr0.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/apps/keymaps/keymap-ypr0.c b/apps/keymaps/keymap-ypr0.c index 99b692e920..2d6be5b7ec 100644 --- a/apps/keymaps/keymap-ypr0.c +++ b/apps/keymaps/keymap-ypr0.c | |||
@@ -52,15 +52,20 @@ static const struct button_mapping button_context_standard[] = { | |||
52 | { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | 52 | { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, |
53 | { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | 53 | { ACTION_STD_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, |
54 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | 54 | { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, |
55 | |||
56 | { ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REL, BUTTON_NONE }, | 55 | { ACTION_STD_CONTEXT, BUTTON_MENU|BUTTON_REL, BUTTON_NONE }, |
57 | { ACTION_STD_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | ||
58 | 56 | ||
59 | { ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | 57 | { ACTION_STD_KEYLOCK, BUTTON_USER|BUTTON_POWER, BUTTON_NONE }, |
60 | 58 | ||
61 | LAST_ITEM_IN_LIST | 59 | LAST_ITEM_IN_LIST |
62 | }; /* button_context_standard */ | 60 | }; /* button_context_standard */ |
63 | 61 | ||
62 | |||
63 | static const struct button_mapping button_context_mainmenu[] = { | ||
64 | { ACTION_TREE_WPS, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
65 | |||
66 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_TREE), | ||
67 | }; /* button_context_mainmenu */ | ||
68 | |||
64 | static const struct button_mapping button_context_wps[] = { | 69 | static const struct button_mapping button_context_wps[] = { |
65 | { ACTION_WPS_PLAY, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, | 70 | { ACTION_WPS_PLAY, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT }, |
66 | { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, | 71 | { ACTION_WPS_STOP, BUTTON_POWER|BUTTON_REPEAT, BUTTON_NONE }, |
@@ -68,10 +73,13 @@ static const struct button_mapping button_context_wps[] = { | |||
68 | { ACTION_WPS_BROWSE, BUTTON_BACK|BUTTON_REL, BUTTON_BACK }, | 73 | { ACTION_WPS_BROWSE, BUTTON_BACK|BUTTON_REL, BUTTON_BACK }, |
69 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | 74 | { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, |
70 | 75 | ||
71 | /* NOTE: this is available only enabling AB-Repeat mode */ | 76 | |
72 | { ACTION_WPS_HOTKEY, BUTTON_USER|BUTTON_REL, BUTTON_USER }, | 77 | { ACTION_WPS_HOTKEY, BUTTON_USER|BUTTON_REL, BUTTON_USER }, |
73 | { ACTION_WPSAB_SINGLE, BUTTON_USER|BUTTON_REPEAT, BUTTON_NONE }, | 78 | { ACTION_WPS_PITCHSCREEN, BUTTON_USER|BUTTON_REPEAT, BUTTON_NONE }, |
74 | { ACTION_STD_KEYLOCK, BUTTON_POWER|BUTTON_REL, BUTTON_POWER }, | 79 | |
80 | { ACTION_STD_KEYLOCK, BUTTON_USER|BUTTON_POWER, BUTTON_NONE }, | ||
81 | |||
82 | |||
75 | { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, | 83 | { ACTION_WPS_CONTEXT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_SELECT }, |
76 | { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, | 84 | { ACTION_WPS_QUICKSCREEN, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE }, |
77 | 85 | ||
@@ -83,7 +91,6 @@ static const struct button_mapping button_context_wps[] = { | |||
83 | { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | 91 | { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
84 | { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, | 92 | { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT }, |
85 | 93 | ||
86 | |||
87 | { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | 94 | { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
88 | { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, | 95 | { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE }, |
89 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, | 96 | { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE }, |
@@ -140,8 +147,7 @@ static const struct button_mapping button_context_colorchooser[] = { //check | |||
140 | }; /* button_context_colorchooser */ | 147 | }; /* button_context_colorchooser */ |
141 | 148 | ||
142 | static const struct button_mapping button_context_eq[] = { | 149 | static const struct button_mapping button_context_eq[] = { |
143 | 150 | { ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | |
144 | { ACTION_STD_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU }, | ||
145 | { ACTION_SETTINGS_INC, BUTTON_RIGHT , BUTTON_NONE }, | 151 | { ACTION_SETTINGS_INC, BUTTON_RIGHT , BUTTON_NONE }, |
146 | { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, | 152 | { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, |
147 | { ACTION_SETTINGS_DEC, BUTTON_LEFT , BUTTON_NONE }, | 153 | { ACTION_SETTINGS_DEC, BUTTON_LEFT , BUTTON_NONE }, |
@@ -152,11 +158,12 @@ static const struct button_mapping button_context_eq[] = { | |||
152 | 158 | ||
153 | /** Bookmark Screen **/ | 159 | /** Bookmark Screen **/ |
154 | static const struct button_mapping button_context_bmark[] = { | 160 | static const struct button_mapping button_context_bmark[] = { |
161 | { ACTION_BMS_DELETE, BUTTON_POWER, BUTTON_NONE }, | ||
162 | |||
155 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), | 163 | LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), |
156 | }; /* button_context_bmark */ | 164 | }; /* button_context_bmark */ |
157 | 165 | ||
158 | static const struct button_mapping button_context_time[] = { | 166 | static const struct button_mapping button_context_time[] = { |
159 | |||
160 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, | 167 | { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE }, |
161 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | 168 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
162 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, | 169 | { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE }, |
@@ -170,7 +177,6 @@ static const struct button_mapping button_context_time[] = { | |||
170 | }; /* button_context_time */ | 177 | }; /* button_context_time */ |
171 | 178 | ||
172 | static const struct button_mapping button_context_quickscreen[] = { | 179 | static const struct button_mapping button_context_quickscreen[] = { |
173 | |||
174 | { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE }, | 180 | { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE }, |
175 | { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | 181 | { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
176 | { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, | 182 | { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE }, |
@@ -185,7 +191,6 @@ static const struct button_mapping button_context_quickscreen[] = { | |||
185 | }; /* button_context_quickscreen */ | 191 | }; /* button_context_quickscreen */ |
186 | 192 | ||
187 | static const struct button_mapping button_context_pitchscreen[] = { | 193 | static const struct button_mapping button_context_pitchscreen[] = { |
188 | |||
189 | { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, | 194 | { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE }, |
190 | { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | 195 | { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
191 | { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, | 196 | { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE }, |
@@ -208,7 +213,6 @@ static const struct button_mapping button_context_pitchscreen[] = { | |||
208 | }; /* button_context_pitchcreen */ | 213 | }; /* button_context_pitchcreen */ |
209 | 214 | ||
210 | static const struct button_mapping button_context_keyboard[] = { | 215 | static const struct button_mapping button_context_keyboard[] = { |
211 | |||
212 | { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, | 216 | { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE }, |
213 | { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, | 217 | { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE }, |
214 | { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, | 218 | { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE }, |
@@ -236,7 +240,7 @@ static const struct button_mapping button_context_radio[] = { | |||
236 | { ACTION_FM_PLAY, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT }, | 240 | { ACTION_FM_PLAY, BUTTON_SELECT | BUTTON_REL, BUTTON_SELECT }, |
237 | { ACTION_FM_NEXT_PRESET, BUTTON_USER | BUTTON_RIGHT, BUTTON_NONE }, | 241 | { ACTION_FM_NEXT_PRESET, BUTTON_USER | BUTTON_RIGHT, BUTTON_NONE }, |
238 | { ACTION_FM_PREV_PRESET, BUTTON_USER | BUTTON_LEFT, BUTTON_NONE }, | 242 | { ACTION_FM_PREV_PRESET, BUTTON_USER | BUTTON_LEFT, BUTTON_NONE }, |
239 | { ACTION_STD_KEYLOCK, BUTTON_POWER | BUTTON_REL, BUTTON_POWER }, | 243 | |
240 | /* Volume */ | 244 | /* Volume */ |
241 | { ACTION_SETTINGS_INC, BUTTON_UP | BUTTON_REPEAT, BUTTON_NONE }, | 245 | { ACTION_SETTINGS_INC, BUTTON_UP | BUTTON_REPEAT, BUTTON_NONE }, |
242 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP, BUTTON_NONE }, | 246 | { ACTION_SETTINGS_INCREPEAT, BUTTON_UP, BUTTON_NONE }, |
@@ -261,6 +265,8 @@ const struct button_mapping* get_context_mapping(int context) | |||
261 | case CONTEXT_LIST: | 265 | case CONTEXT_LIST: |
262 | return button_context_list; | 266 | return button_context_list; |
263 | case CONTEXT_MAINMENU: | 267 | case CONTEXT_MAINMENU: |
268 | return button_context_mainmenu; | ||
269 | |||
264 | case CONTEXT_TREE: | 270 | case CONTEXT_TREE: |
265 | return button_context_tree; | 271 | return button_context_tree; |
266 | 272 | ||