From febf4a95bd241604d64f081b0e6a9294bac76e9e Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 24 Jan 2017 20:25:31 +0100 Subject: [PATCH] Fix the key holding case For some delays, the holding was not long enough, or it never triggered. Do that independently of the other cases, in a separate branch, instead of chaining it into an else branch. This makes the example work as desired. Signed-off-by: Gergely Nagy --- src/Akela/GhostInTheFirmware.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Akela/GhostInTheFirmware.cpp b/src/Akela/GhostInTheFirmware.cpp index 62c38ab6..3a5d465a 100644 --- a/src/Akela/GhostInTheFirmware.cpp +++ b/src/Akela/GhostInTheFirmware.cpp @@ -61,7 +61,9 @@ namespace Akela { byte col = pgm_read_byte (&(ghostKeys[currentPos].col)); handle_key_event (Key_NoKey, row, col, WAS_PRESSED); - } else if (timer < timeOut / 3) { + } + + if (timer < timeOut / 3) { byte row = pgm_read_byte (&(ghostKeys[currentPos].row)); byte col = pgm_read_byte (&(ghostKeys[currentPos].col));