|
|
|
@ -30,17 +30,16 @@ EventHandlerResult GeminiPR::onNameQuery() {
|
|
|
|
|
return ::Focus.sendName(F("GeminiPR"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EventHandlerResult GeminiPR::onKeyswitchEvent(Key &mapped_key, KeyAddr key_addr, uint8_t keyState) {
|
|
|
|
|
if (mapped_key < geminipr::START ||
|
|
|
|
|
mapped_key > geminipr::END)
|
|
|
|
|
EventHandlerResult GeminiPR::onKeyEvent(KeyEvent &event) {
|
|
|
|
|
if (event.key < geminipr::START || event.key > geminipr::END)
|
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
|
|
|
|
|
|
if (keyToggledOn(keyState)) {
|
|
|
|
|
uint8_t key = mapped_key.getRaw() - geminipr::START;
|
|
|
|
|
if (keyToggledOn(event.state)) {
|
|
|
|
|
uint8_t key = event.key.getRaw() - geminipr::START;
|
|
|
|
|
++keys_held_;
|
|
|
|
|
|
|
|
|
|
state_[key / 7] |= 1 << (6 - (key % 7));
|
|
|
|
|
} else if (keyToggledOff(keyState)) {
|
|
|
|
|
} else {
|
|
|
|
|
--keys_held_;
|
|
|
|
|
|
|
|
|
|
if (keys_held_ == 0) {
|
|
|
|
|