From 5c3e2966c46dfd91206ccb9f30af7e851e57bea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Wed, 27 Jun 2018 21:42:15 +0200 Subject: [PATCH] Restore the logic of the key debouncer. Make it only debounce keypresses and set its timeout to 100ms. --- lib/agent | 2 +- right/src/key_debouncer.h | 2 +- right/src/usb_report_updater.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/agent b/lib/agent index 81a8399..32d9635 160000 --- a/lib/agent +++ b/lib/agent @@ -1 +1 @@ -Subproject commit 81a83994abe36f653abf18ee2daaa7c2f198b14a +Subproject commit 32d9635b340e4dfbb12fdcfc909ec89e488ce56a diff --git a/right/src/key_debouncer.h b/right/src/key_debouncer.h index 25a35b4..c6455bc 100644 --- a/right/src/key_debouncer.h +++ b/right/src/key_debouncer.h @@ -9,7 +9,7 @@ // Macros: #define KEY_DEBOUNCER_INTERVAL_MSEC 1 - #define KEY_DEBOUNCER_TIMEOUT_MSEC 5 + #define KEY_DEBOUNCER_TIMEOUT_MSEC 100 // Functions: diff --git a/right/src/usb_report_updater.c b/right/src/usb_report_updater.c index 0194de2..2fdf5ed 100644 --- a/right/src/usb_report_updater.c +++ b/right/src/usb_report_updater.c @@ -326,7 +326,7 @@ static void updateActiveUsbReports(void) if (keyState->debounceCounter) { keyState->current = keyState->previous; - } else if (keyState->previous != keyState->current) { + } else if (!keyState->previous && keyState->current) { keyState->debounceCounter = KEY_DEBOUNCER_TIMEOUT_MSEC + 1; }