summaryrefslogtreecommitdiff
path: root/apps/action.c
diff options
context:
space:
mode:
authorDana Conrad <dconrad@fastmail.com>2021-06-06 13:33:03 -0500
committerAidan MacDonald <amachronic@protonmail.com>2021-06-12 21:11:28 +0000
commitc067b344e8da0c9b6a9b785100661f598f64a5d3 (patch)
treeb58da29a4ee4dfa097586b6c4b1411b9f4ecda01 /apps/action.c
parentf3f9d1fb9533529776ded4fd3af7fd274ba5f2fe (diff)
downloadrockbox-c067b344e8da0c9b6a9b785100661f598f64a5d3.tar.gz
rockbox-c067b344e8da0c9b6a9b785100661f598f64a5d3.zip
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
Diffstat (limited to 'apps/action.c')
-rw-r--r--apps/action.c14
1 files changed, 14 insertions, 0 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)
683 if (is_timeout) 683 if (is_timeout)
684 { 684 {
685 do_key_lock(true); 685 do_key_lock(true);
686
687#if defined(HAVE_TOUCHPAD)
688 /* if the touchpad is supposed to be off and the current buttonpress
689 * is from the touchpad, nullify both button and action. */
690 if (!has_flag(action_last.softlock_mask, SEL_ACTION_ENABLED) ||
691 has_flag(action_last.softlock_mask, SEL_ACTION_NOTOUCH))
692 {
693 cur->button = touchpad_filter(cur->button);
694 if (cur->button == BUTTON_NONE)
695 {
696 action = ACTION_NONE;
697 }
698 }
699#endif
686 } 700 }
687 else if (action == ACTION_STD_KEYLOCK) 701 else if (action == ACTION_STD_KEYLOCK)
688 { 702 {