From 417ff1a07e22c5cde66ab687331790454c11d472 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Wed, 25 Jan 2017 11:24:19 +0100 Subject: [PATCH] OneShot: Allow chaining one-shots When another one-shot key is pressed, reset the timer, and handle it as if starting anew, but without cancelling any previous one-shots. This allows one to chain one-shots together. Fixes #3. Signed-off-by: Gergely Nagy --- src/Akela/OneShot.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Akela/OneShot.cpp b/src/Akela/OneShot.cpp index 3d22cfd8..eccf9bf2 100644 --- a/src/Akela/OneShot.cpp +++ b/src/Akela/OneShot.cpp @@ -179,6 +179,13 @@ namespace Akela { setSticky (idx); saveAsPrevious (mappedKey); + } else { + Timer = 0; + + setOneShot (idx); + saveAsPrevious (mappedKey); + + activateOneShot (idx); } } }