From 1844d88c76973a199fb70b2e72b7397b8889086b Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 31 May 2018 10:22:53 +0200 Subject: [PATCH] Do not cancel OneShot if a oneshot is still held Fixes #5. Signed-off-by: Gergely Nagy --- README.md | 5 +++-- src/Kaleidoscope/Escape-OneShot.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0b92d55b..3e82aa6d 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,9 @@ [st:experimental]: https://img.shields.io/badge/experimental----black.svg?style=flat&colorA=dfb317&colorB=494e52 Turn the `Esc` key into a special key, that can cancel any active `OneShot` -effect - or act as the normal `Esc` key if none are active. For those times when -one accidentally presses a one-shot key, or change their minds. +effect - or act as the normal `Esc` key if none are active, or if any of them +are still held. For those times when one accidentally presses a one-shot key, or +change their minds. ## Using the plugin diff --git a/src/Kaleidoscope/Escape-OneShot.cpp b/src/Kaleidoscope/Escape-OneShot.cpp index 0875eb27..96693390 100644 --- a/src/Kaleidoscope/Escape-OneShot.cpp +++ b/src/Kaleidoscope/Escape-OneShot.cpp @@ -28,7 +28,7 @@ EventHandlerResult EscapeOneShot::onKeyswitchEvent(Key &mapped_key, byte row, by !keyToggledOn(keyState)) return EventHandlerResult::OK; - if (!::OneShot.isActive()) + if (!::OneShot.isActive() || ::OneShot.isPressed()) return EventHandlerResult::OK; KeyboardHardware.maskKey(row, col);