diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2023-03-17 23:43:39 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2023-03-18 17:47:19 +0000 |
commit | a0a59ab61019bc06d85f4db34a74a3b53f15f3b4 (patch) | |
tree | cecfd61c4e08b9e30903abed7cb790b1cd36b855 /apps/keymaps/keymap-xduoox20.c | |
parent | 0c29d1788eae87eb1cba71a70b1facd6ff995eb2 (diff) | |
download | rockbox-a0a59ab61019bc06d85f4db34a74a3b53f15f3b4.tar.gz rockbox-a0a59ab61019bc06d85f4db34a74a3b53f15f3b4.zip |
Fix locked context fallthrough
Enabling locked actions for all softlock targets accidentally
broke keylock on touchscreens because the generic touchscreen
keymap was missed. Trying to lookup CONTEXT_WPS|CONTEXT_LOCKED
returned the mapping for CONTEXT_STD because the locked version
wasn't explicitly handled.
But on almost all cases, a context's keymap does not change when
the screen is locked. It makes more sense to mask out the locked
flag and only check for it where needed.
Change-Id: I65cda2de82950d272d4394fd772286699e7c3779
Diffstat (limited to 'apps/keymaps/keymap-xduoox20.c')
-rw-r--r-- | apps/keymaps/keymap-xduoox20.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/apps/keymaps/keymap-xduoox20.c b/apps/keymaps/keymap-xduoox20.c index 04d57949a1..fa4076e27d 100644 --- a/apps/keymaps/keymap-xduoox20.c +++ b/apps/keymaps/keymap-xduoox20.c | |||
@@ -184,11 +184,10 @@ static const struct button_mapping button_context_yesnoscreen[] = { | |||
184 | /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ | 184 | /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ |
185 | const struct button_mapping* get_context_mapping(int context) | 185 | const struct button_mapping* get_context_mapping(int context) |
186 | { | 186 | { |
187 | switch (context) | 187 | switch (context & ~CONTEXT_LOCKED) |
188 | { | 188 | { |
189 | case CONTEXT_LIST: | 189 | case CONTEXT_LIST: |
190 | return button_context_list; | 190 | return button_context_list; |
191 | case CONTEXT_STD | CONTEXT_LOCKED: | ||
192 | case CONTEXT_STD: | 191 | case CONTEXT_STD: |
193 | return button_context_standard; | 192 | return button_context_standard; |
194 | case CONTEXT_BOOKMARKSCREEN: | 193 | case CONTEXT_BOOKMARKSCREEN: |
@@ -207,10 +206,8 @@ const struct button_mapping* get_context_mapping(int context) | |||
207 | case CONTEXT_SETTINGS_RECTRIGGER: | 206 | case CONTEXT_SETTINGS_RECTRIGGER: |
208 | return button_context_settings_vol_is_inc; | 207 | return button_context_settings_vol_is_inc; |
209 | case CONTEXT_TREE: | 208 | case CONTEXT_TREE: |
210 | case CONTEXT_MAINMENU | CONTEXT_LOCKED: | ||
211 | case CONTEXT_MAINMENU: | 209 | case CONTEXT_MAINMENU: |
212 | return button_context_tree; | 210 | return button_context_tree; |
213 | case CONTEXT_WPS | CONTEXT_LOCKED: | ||
214 | case CONTEXT_WPS: | 211 | case CONTEXT_WPS: |
215 | return button_context_wps; | 212 | return button_context_wps; |
216 | case CONTEXT_YESNOSCREEN: | 213 | case CONTEXT_YESNOSCREEN: |