From a0a59ab61019bc06d85f4db34a74a3b53f15f3b4 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Fri, 17 Mar 2023 23:43:39 +0000 Subject: 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 --- apps/keymaps/keymap-shanlingq1.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'apps/keymaps/keymap-shanlingq1.c') 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[] = { const struct button_mapping* target_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: case CONTEXT_WPS: return button_context_wps; case CONTEXT_TREE: case CONTEXT_CUSTOM|CONTEXT_TREE: - case CONTEXT_MAINMENU | CONTEXT_LOCKED: case CONTEXT_MAINMENU: case CONTEXT_BOOKMARKSCREEN: case CONTEXT_LIST: -- cgit v1.2.3