From c067b344e8da0c9b6a9b785100661f598f64a5d3 Mon Sep 17 00:00:00 2001 From: Dana Conrad Date: Sun, 6 Jun 2021 13:33:03 -0500 Subject: [PATCH] FS#13297: M3K Autolock allows one action before disabling touchpad Intercept buttonpress and action, and nullify both if the button is part of the touchpad. Only affects autolock functionality. Adding removal of note about autolock in the manual - the lock button no longer needs to be pressed at least once to prime the autolock, if enabled, since commit 14f7a95 Change-Id: Ic3582764df490d96abc2d78116f23cbe0fdd6173 --- apps/action.c | 14 ++++++++++++++ manual/configure_rockbox/system_options.tex | 2 -- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/action.c b/apps/action.c index 15422f987b..5533c00241 100644 --- a/apps/action.c +++ b/apps/action.c @@ -683,6 +683,20 @@ static inline int do_auto_softlock(action_last_t *last, action_cur_t *cur) if (is_timeout) { do_key_lock(true); + +#if defined(HAVE_TOUCHPAD) + /* if the touchpad is supposed to be off and the current buttonpress + * is from the touchpad, nullify both button and action. */ + if (!has_flag(action_last.softlock_mask, SEL_ACTION_ENABLED) || + has_flag(action_last.softlock_mask, SEL_ACTION_NOTOUCH)) + { + cur->button = touchpad_filter(cur->button); + if (cur->button == BUTTON_NONE) + { + action = ACTION_NONE; + } + } +#endif } else if (action == ACTION_STD_KEYLOCK) { diff --git a/manual/configure_rockbox/system_options.tex b/manual/configure_rockbox/system_options.tex index 59acdaa5f9..32c389e593 100755 --- a/manual/configure_rockbox/system_options.tex +++ b/manual/configure_rockbox/system_options.tex @@ -289,8 +289,6 @@ therefore result in better runtime. list above. The device can be locked and unlocked manually, but the lock will always engage when the backlight turns off. Requires Autolock On to be enabled. - \note{The lock button must be pressed at least once after enabling - this setting and at least once every time the device is powered up.} } %\opt{HAVE_BACKLIGHT} \opt{touchpad}{ \item[Disable Touch.]