From c067b344e8da0c9b6a9b785100661f598f64a5d3 Mon Sep 17 00:00:00 2001 From: Dana Conrad Date: Sun, 6 Jun 2021 13:33:03 -0500 Subject: 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 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps') 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) { -- cgit v1.2.3