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-xduoox20.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'apps/keymaps/keymap-xduoox20.c') 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[] = { /* get_context_mapping returns a pointer to one of the above defined arrays depending on the context */ const struct button_mapping* get_context_mapping(int context) { - switch (context) + switch (context & ~CONTEXT_LOCKED) { case CONTEXT_LIST: return button_context_list; - case CONTEXT_STD | CONTEXT_LOCKED: case CONTEXT_STD: return button_context_standard; case CONTEXT_BOOKMARKSCREEN: @@ -207,10 +206,8 @@ const struct button_mapping* get_context_mapping(int context) case CONTEXT_SETTINGS_RECTRIGGER: return button_context_settings_vol_is_inc; case CONTEXT_TREE: - case CONTEXT_MAINMENU | CONTEXT_LOCKED: case CONTEXT_MAINMENU: return button_context_tree; - case CONTEXT_WPS | CONTEXT_LOCKED: case CONTEXT_WPS: return button_context_wps; case CONTEXT_YESNOSCREEN: -- cgit v1.2.3