From 83093d94c078200cd3479fc71b6f02af39a3ef4c Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:46:54 -0700 Subject: [PATCH] Make multi-tap a little more sensitive, require less of a pause, fix driver orientation "convention" --- modules/xrealInterfaceLibrary | 2 +- src/multitap.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/xrealInterfaceLibrary b/modules/xrealInterfaceLibrary index fffa84e..e2d5d12 160000 --- a/modules/xrealInterfaceLibrary +++ b/modules/xrealInterfaceLibrary @@ -1 +1 @@ -Subproject commit fffa84e1b2c8e01d489129ed412a891d367bfefd +Subproject commit e2d5d129e7d045f168515a02f00607c55e1ad04a diff --git a/src/multitap.c b/src/multitap.c index 084120a..ee3bb18 100644 --- a/src/multitap.c +++ b/src/multitap.c @@ -13,14 +13,14 @@ const int mt_state_rise = 1; const int mt_state_fall = 2; const int mt_state_pause = 3; int mt_state = mt_state_idle; -const float mt_detect_threshold = 2500.0; +const float mt_detect_threshold = 2000.0; const float mt_pause_threshold = 100.0; uint64_t tap_start_time = 0; uint64_t pause_start_time = 0; uint64_t last_logged_peak_time = 0; const int max_tap_period_ms = 500; // longest time-frame to allow between tap starts/rises const int max_tap_rise_ms = 100; // a single tap should be very quick, ignore long accelerations -const int min_pause_ms = 50 - MT_BUFFER_SIZE; // must detect a pause (~0 acceleration) between taps +const int min_pause_ms = 10; // must detect a pause (~0 acceleration) between taps float peak_max = 0.0; int tap_count = 0;