Adapt Redial plugin to KeyEvent handlers

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1024/head
Michael Richters 4 years ago
parent b5a006c228
commit 9352117e74
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -28,12 +28,12 @@ EventHandlerResult Redial::onNameQuery() {
return ::Focus.sendName(F("Redial"));
}
EventHandlerResult Redial::onKeyswitchEvent(Key &mapped_key, KeyAddr key_addr, uint8_t key_state) {
if (keyToggledOn(key_state)) {
if (mapped_key == Key_Redial) {
mapped_key = last_key_;
} else if (shouldRemember(mapped_key)) {
last_key_ = mapped_key;
EventHandlerResult Redial::onKeyEvent(KeyEvent &event) {
if (keyToggledOn(event.state)) {
if (event.key == Key_Redial) {
event.key = last_key_;
} else if (shouldRemember(event.key)) {
last_key_ = event.key;
}
}
return EventHandlerResult::OK;

@ -32,7 +32,7 @@ class Redial : public kaleidoscope::Plugin {
static bool shouldRemember(Key mappedKey);
EventHandlerResult onNameQuery();
EventHandlerResult onKeyswitchEvent(Key &mapped_key, KeyAddr key_addr, uint8_t key_state);
EventHandlerResult onKeyEvent(KeyEvent &event);
private:
static Key last_key_;

Loading…
Cancel
Save