From d5676fcd90cc3278df173a71502dc04d74813883 Mon Sep 17 00:00:00 2001 From: Dana Conrad Date: Fri, 19 Mar 2021 19:13:58 -0500 Subject: [PATCH] If backlight is off and keys are unlocked, power button wakes screen only tested on erosq On devices with both a backlight and a softlock button, currently pressing the softlock button while the screen is off and the keypad is unlocked will wake the screen and also lock the keypad. Presumably, the user's intention is to use the device when they hit the softlock button in this state, so wake the screen without locking the keypad. Change-Id: Ib00e1c37142e5d3d9317775de5cf0dd67f3f2569 --- apps/action.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/action.c b/apps/action.c index d2fef6f513..858a761219 100644 --- a/apps/action.c +++ b/apps/action.c @@ -730,10 +730,19 @@ static inline void do_softlock(action_last_t *last, action_cur_t *cur) { action = do_auto_softlock(last, cur); } + /* Lock/Unlock toggled by ACTION_STD_KEYLOCK presses*/ if ((action == ACTION_STD_KEYLOCK) || (last->keys_locked && last->unlock_combo == cur->button)) { +#ifdef HAVE_BACKLIGHT + // if backlight is off and keys are unlocked, do nothing and exit. + // The backlight should come on without locking keypad. + if ((!last->keys_locked) && (!is_backlight_on(false))) + { + return; + } +#endif last->unlock_combo = cur->button; do_key_lock(!last->keys_locked); notify_user = true;