Merge pull request #435 from keyboardio/oneshot/escape-sticky

OneShot: Fix EscapeOneShot so that it cancels stickies too
pull/438/head
Jesse Vincent 6 years ago committed by GitHub
commit f092c6e7ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,8 +28,9 @@ EventHandlerResult EscapeOneShot::onKeyswitchEvent(Key &mapped_key, byte row, by
!keyToggledOn(keyState)) !keyToggledOn(keyState))
return EventHandlerResult::OK; return EventHandlerResult::OK;
if (!::OneShot.isActive() || ::OneShot.isPressed()) if ((!::OneShot.isActive() || ::OneShot.isPressed()) && !::OneShot.isSticky()) {
return EventHandlerResult::OK; return EventHandlerResult::OK;
}
KeyboardHardware.maskKey(row, col); KeyboardHardware.maskKey(row, col);

@ -37,6 +37,9 @@ class OneShot : public kaleidoscope::Plugin {
static bool isPressed() { static bool isPressed() {
return !!pressed_state_.all; return !!pressed_state_.all;
} }
static bool isSticky() {
return !!sticky_state_.all;
}
static bool isActive(Key key); static bool isActive(Key key);
static bool isSticky(Key key); static bool isSticky(Key key);
static void cancel(bool with_stickies); static void cancel(bool with_stickies);

Loading…
Cancel
Save