summaryrefslogtreecommitdiff
path: root/apps/keymaps/keymap-shanlingq1.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2023-03-17 23:43:39 +0000
committerAidan MacDonald <amachronic@protonmail.com>2023-03-18 17:47:19 +0000
commita0a59ab61019bc06d85f4db34a74a3b53f15f3b4 (patch)
treececfd61c4e08b9e30903abed7cb790b1cd36b855 /apps/keymaps/keymap-shanlingq1.c
parent0c29d1788eae87eb1cba71a70b1facd6ff995eb2 (diff)
downloadrockbox-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-shanlingq1.c')
-rw-r--r--apps/keymaps/keymap-shanlingq1.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/apps/keymaps/keymap-shanlingq1.c b/apps/keymaps/keymap-shanlingq1.c
index 2708266d18..f8fefe5ff3 100644
--- a/apps/keymaps/keymap-shanlingq1.c
+++ b/apps/keymaps/keymap-shanlingq1.c
@@ -69,18 +69,15 @@ static const struct button_mapping button_context_yesno[] = {
69 69
70const struct button_mapping* target_get_context_mapping(int context) 70const struct button_mapping* target_get_context_mapping(int context)
71{ 71{
72 switch (context) 72 switch (context & ~CONTEXT_LOCKED)
73 { 73 {
74 default: 74 default:
75 case CONTEXT_STD | CONTEXT_LOCKED:
76 case CONTEXT_STD: 75 case CONTEXT_STD:
77 return button_context_standard; 76 return button_context_standard;
78 case CONTEXT_WPS | CONTEXT_LOCKED:
79 case CONTEXT_WPS: 77 case CONTEXT_WPS:
80 return button_context_wps; 78 return button_context_wps;
81 case CONTEXT_TREE: 79 case CONTEXT_TREE:
82 case CONTEXT_CUSTOM|CONTEXT_TREE: 80 case CONTEXT_CUSTOM|CONTEXT_TREE:
83 case CONTEXT_MAINMENU | CONTEXT_LOCKED:
84 case CONTEXT_MAINMENU: 81 case CONTEXT_MAINMENU:
85 case CONTEXT_BOOKMARKSCREEN: 82 case CONTEXT_BOOKMARKSCREEN:
86 case CONTEXT_LIST: 83 case CONTEXT_LIST: