|
|
@ -19,21 +19,21 @@
|
|
|
|
#include <Kaleidoscope-EEPROM-Keymap-Programmer.h>
|
|
|
|
#include <Kaleidoscope-EEPROM-Keymap-Programmer.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace KaleidoscopePlugins {
|
|
|
|
namespace KaleidoscopePlugins {
|
|
|
|
uint16_t EEPROMKeymapProgrammer::updatePosition;
|
|
|
|
uint16_t EEPROMKeymapProgrammer::updatePosition;
|
|
|
|
EEPROMKeymapProgrammer::state_t EEPROMKeymapProgrammer::state;
|
|
|
|
EEPROMKeymapProgrammer::state_t EEPROMKeymapProgrammer::state;
|
|
|
|
EEPROMKeymapProgrammer::mode_t EEPROMKeymapProgrammer::mode;
|
|
|
|
EEPROMKeymapProgrammer::mode_t EEPROMKeymapProgrammer::mode;
|
|
|
|
Key EEPROMKeymapProgrammer::newKey;
|
|
|
|
Key EEPROMKeymapProgrammer::newKey;
|
|
|
|
|
|
|
|
|
|
|
|
EEPROMKeymapProgrammer::EEPROMKeymapProgrammer (void) {
|
|
|
|
EEPROMKeymapProgrammer::EEPROMKeymapProgrammer (void) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
EEPROMKeymapProgrammer::begin (void) {
|
|
|
|
EEPROMKeymapProgrammer::begin (void) {
|
|
|
|
event_handler_hook_use (eventHandlerHook);
|
|
|
|
event_handler_hook_use (eventHandlerHook);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
EEPROMKeymapProgrammer::nextState (void) {
|
|
|
|
EEPROMKeymapProgrammer::nextState (void) {
|
|
|
|
switch (state) {
|
|
|
|
switch (state) {
|
|
|
|
case INACTIVE:
|
|
|
|
case INACTIVE:
|
|
|
|
state = WAIT_FOR_KEY;
|
|
|
|
state = WAIT_FOR_KEY;
|
|
|
@ -50,17 +50,17 @@ namespace KaleidoscopePlugins {
|
|
|
|
cancel ();
|
|
|
|
cancel ();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
EEPROMKeymapProgrammer::cancel (void) {
|
|
|
|
EEPROMKeymapProgrammer::cancel (void) {
|
|
|
|
updatePosition = 0;
|
|
|
|
updatePosition = 0;
|
|
|
|
newKey = Key_NoKey;
|
|
|
|
newKey = Key_NoKey;
|
|
|
|
state = INACTIVE;
|
|
|
|
state = INACTIVE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Key
|
|
|
|
Key
|
|
|
|
EEPROMKeymapProgrammer::eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState) {
|
|
|
|
EEPROMKeymapProgrammer::eventHandlerHook (Key mappedKey, byte row, byte col, uint8_t keyState) {
|
|
|
|
if (state == INACTIVE)
|
|
|
|
if (state == INACTIVE)
|
|
|
|
return mappedKey;
|
|
|
|
return mappedKey;
|
|
|
|
|
|
|
|
|
|
|
@ -103,7 +103,7 @@ namespace KaleidoscopePlugins {
|
|
|
|
newKey.raw = newKey.raw * 10 + n;
|
|
|
|
newKey.raw = newKey.raw * 10 + n;
|
|
|
|
|
|
|
|
|
|
|
|
return Key_NoKey;
|
|
|
|
return Key_NoKey;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|