|
|
@ -22,25 +22,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace KaleidoscopePlugins {
|
|
|
|
namespace KaleidoscopePlugins {
|
|
|
|
|
|
|
|
|
|
|
|
EscapeOneShot::EscapeOneShot (void) {
|
|
|
|
EscapeOneShot::EscapeOneShot(void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
EscapeOneShot::begin (void) {
|
|
|
|
EscapeOneShot::begin(void) {
|
|
|
|
event_handler_hook_use (eventHandlerHook);
|
|
|
|
event_handler_hook_use(eventHandlerHook);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Key
|
|
|
|
Key
|
|
|
|
EscapeOneShot::eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState) {
|
|
|
|
EscapeOneShot::eventHandlerHook(Key mappedKey, byte row, byte col, uint8_t keyState) {
|
|
|
|
if (mappedKey.raw != Key_Escape.raw ||
|
|
|
|
if (mappedKey.raw != Key_Escape.raw ||
|
|
|
|
(keyState & INJECTED) ||
|
|
|
|
(keyState & INJECTED) ||
|
|
|
|
!key_toggled_on (keyState))
|
|
|
|
!key_toggled_on(keyState))
|
|
|
|
return mappedKey;
|
|
|
|
return mappedKey;
|
|
|
|
|
|
|
|
|
|
|
|
if (!OneShot::isActive ())
|
|
|
|
if (!OneShot::isActive())
|
|
|
|
return mappedKey;
|
|
|
|
return mappedKey;
|
|
|
|
|
|
|
|
|
|
|
|
OneShot::cancel ();
|
|
|
|
OneShot::cancel();
|
|
|
|
|
|
|
|
|
|
|
|
return Key_NoKey;
|
|
|
|
return Key_NoKey;
|
|
|
|
}
|
|
|
|
}
|
|
|
|