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-fiiom3k.c | |
parent | 0c29d1788eae87eb1cba71a70b1facd6ff995eb2 (diff) | |
download | rockbox-a0a59ab610.tar.gz rockbox-a0a59ab610.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-fiiom3k.c')
-rw-r--r-- | apps/keymaps/keymap-fiiom3k.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/apps/keymaps/keymap-fiiom3k.c b/apps/keymaps/keymap-fiiom3k.c index 8b9cce2493..01fe3a689c 100644 --- a/apps/keymaps/keymap-fiiom3k.c +++ b/apps/keymaps/keymap-fiiom3k.c @@ -324,18 +324,16 @@ static const struct button_mapping button_context_usb_hid_mode_browser[] = { const struct button_mapping* get_context_mapping(int context) { - switch (context) + switch (context & ~CONTEXT_LOCKED) { default: - case CONTEXT_STD | CONTEXT_LOCKED: case CONTEXT_STD: return button_context_standard; - case CONTEXT_WPS | CONTEXT_LOCKED: - return button_context_wps_locked; case CONTEXT_WPS: + if (context & CONTEXT_LOCKED) + return button_context_wps_locked; return button_context_wps; case CONTEXT_TREE: - case CONTEXT_MAINMENU | CONTEXT_LOCKED: case CONTEXT_MAINMENU: if (global_settings.hold_lr_for_scroll_in_list) return button_context_tree_scroll_lr; |