|
|
@ -23,7 +23,7 @@ namespace plugin {
|
|
|
|
// --- state ---
|
|
|
|
// --- state ---
|
|
|
|
Key Leader::sequence_[LEADER_MAX_SEQUENCE_LENGTH + 1];
|
|
|
|
Key Leader::sequence_[LEADER_MAX_SEQUENCE_LENGTH + 1];
|
|
|
|
uint8_t Leader::sequence_pos_;
|
|
|
|
uint8_t Leader::sequence_pos_;
|
|
|
|
uint32_t Leader::end_time_;
|
|
|
|
uint16_t Leader::start_time_ = 0;
|
|
|
|
uint16_t Leader::time_out = 1000;
|
|
|
|
uint16_t Leader::time_out = 1000;
|
|
|
|
const Leader::dictionary_t *Leader::dictionary;
|
|
|
|
const Leader::dictionary_t *Leader::dictionary;
|
|
|
|
|
|
|
|
|
|
|
@ -93,7 +93,7 @@ EventHandlerResult Leader::onKeyswitchEvent(Key &mapped_key, byte row, byte col,
|
|
|
|
|
|
|
|
|
|
|
|
if (keyToggledOff(keyState)) {
|
|
|
|
if (keyToggledOff(keyState)) {
|
|
|
|
// not active, but a leader key = start the sequence on key release!
|
|
|
|
// not active, but a leader key = start the sequence on key release!
|
|
|
|
end_time_ = millis() + time_out;
|
|
|
|
start_time_ = Kaleidoscope.millisAtCycleStart();
|
|
|
|
sequence_pos_ = 0;
|
|
|
|
sequence_pos_ = 0;
|
|
|
|
sequence_[sequence_pos_].raw = mapped_key.raw;
|
|
|
|
sequence_[sequence_pos_].raw = mapped_key.raw;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -112,7 +112,7 @@ EventHandlerResult Leader::onKeyswitchEvent(Key &mapped_key, byte row, byte col,
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
end_time_ = millis() + time_out;
|
|
|
|
start_time_ = Kaleidoscope.millisAtCycleStart();
|
|
|
|
sequence_[sequence_pos_].raw = mapped_key.raw;
|
|
|
|
sequence_[sequence_pos_].raw = mapped_key.raw;
|
|
|
|
action_index = lookup();
|
|
|
|
action_index = lookup();
|
|
|
|
|
|
|
|
|
|
|
@ -142,7 +142,7 @@ EventHandlerResult Leader::afterEachCycle() {
|
|
|
|
if (!isActive())
|
|
|
|
if (!isActive())
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
|
|
|
|
|
|
|
|
if (millis() >= end_time_)
|
|
|
|
if (Kaleidoscope.hasTimeExpired(start_time_, time_out))
|
|
|
|
reset();
|
|
|
|
reset();
|
|
|
|
|
|
|
|
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|