From 733d5d9c8c935793b1ed640d5045ecaee2abb431 Mon Sep 17 00:00:00 2001 From: sago35 Date: Mon, 30 Oct 2023 20:58:20 +0900 Subject: [PATCH] fix --- kbgpio.go | 4 ++-- kbmatrix.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kbgpio.go b/kbgpio.go index 4ec810f..bfcfbaa 100644 --- a/kbgpio.go +++ b/kbgpio.go @@ -93,9 +93,9 @@ func (d *GpioKeyboard) Get() []State { if d.cycleCounter[c] >= gpioCyclesToPreventChattering { d.State[c] = PressToRelease d.callback(0, c, PressToRelease) - d.cycleCounter[c]++ - } else { d.cycleCounter[c] = 0 + } else { + d.cycleCounter[c]++ } } case PressToRelease: diff --git a/kbmatrix.go b/kbmatrix.go index 4912597..6a29dd9 100644 --- a/kbmatrix.go +++ b/kbmatrix.go @@ -108,9 +108,9 @@ func (d *MatrixKeyboard) Get() []State { if d.cycleCounter[idx] >= matrixCyclesToPreventChattering { d.State[idx] = PressToRelease d.callback(0, idx, PressToRelease) - d.cycleCounter[idx]++ - } else { d.cycleCounter[idx] = 0 + } else { + d.cycleCounter[idx]++ } } case PressToRelease: