|
|
@ -21,35 +21,35 @@
|
|
|
|
using namespace KaleidoscopePlugins::Ranges;
|
|
|
|
using namespace KaleidoscopePlugins::Ranges;
|
|
|
|
|
|
|
|
|
|
|
|
namespace KaleidoscopePlugins {
|
|
|
|
namespace KaleidoscopePlugins {
|
|
|
|
// --- state ---
|
|
|
|
// --- state ---
|
|
|
|
char Syster::symbol[SYSTER_MAX_SYMBOL_LENGTH + 1];
|
|
|
|
char Syster::symbol[SYSTER_MAX_SYMBOL_LENGTH + 1];
|
|
|
|
uint8_t Syster::symbolPos;
|
|
|
|
uint8_t Syster::symbolPos;
|
|
|
|
bool Syster::isActive;
|
|
|
|
bool Syster::isActive;
|
|
|
|
|
|
|
|
|
|
|
|
// --- helpers ---
|
|
|
|
// --- helpers ---
|
|
|
|
|
|
|
|
|
|
|
|
#define isSyster(k) (k == SYSTER)
|
|
|
|
#define isSyster(k) (k == SYSTER)
|
|
|
|
|
|
|
|
|
|
|
|
// --- api ---
|
|
|
|
// --- api ---
|
|
|
|
|
|
|
|
|
|
|
|
Syster::Syster (void) {
|
|
|
|
Syster::Syster (void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
Syster::begin (void) {
|
|
|
|
Syster::begin (void) {
|
|
|
|
event_handler_hook_use (this->eventHandlerHook);
|
|
|
|
event_handler_hook_use (this->eventHandlerHook);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
Syster::reset (void) {
|
|
|
|
Syster::reset (void) {
|
|
|
|
symbolPos = 0;
|
|
|
|
symbolPos = 0;
|
|
|
|
symbol[0] = 0;
|
|
|
|
symbol[0] = 0;
|
|
|
|
isActive = false;
|
|
|
|
isActive = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// --- hooks ---
|
|
|
|
// --- hooks ---
|
|
|
|
Key
|
|
|
|
Key
|
|
|
|
Syster::eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState) {
|
|
|
|
Syster::eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState) {
|
|
|
|
if (!isActive) {
|
|
|
|
if (!isActive) {
|
|
|
|
if (!isSyster (mappedKey))
|
|
|
|
if (!isSyster (mappedKey))
|
|
|
|
return mappedKey;
|
|
|
|
return mappedKey;
|
|
|
@ -101,7 +101,7 @@ namespace KaleidoscopePlugins {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return mappedKey;
|
|
|
|
return mappedKey;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
__attribute__((weak))
|
|
|
|
__attribute__((weak))
|
|
|
|