Fix cancellation on interrupt

Cancel the one-shot state when the interruptor is pressed, not when it is
released. Otherwise, when typing fast, other keys pressed while the interruptor
is still releasing, may have the one-shot effect applied too.

For this to work, we need to do the cancellation post-clear, otherwise the
one-shot modifiers are cleared before they register with the interruptor.

Fixes #1, which used to be keyboardio/Akela#121.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/389/head
Gergely Nagy 8 years ago
parent 090d43ca70
commit 9adf73db87

@ -190,9 +190,6 @@ namespace Akela {
if (key_is_pressed (keyState)) { if (key_is_pressed (keyState)) {
saveAsPrevious (mappedKey); saveAsPrevious (mappedKey);
}
if (key_toggled_off (keyState)) {
shouldCancel = true; shouldCancel = true;
} }
@ -204,7 +201,7 @@ namespace Akela {
if (!State) if (!State)
return; return;
if (!postClear) { if (postClear) {
if (Timer < TimeOut) if (Timer < TimeOut)
Timer++; Timer++;

Loading…
Cancel
Save