Deprecate `Layer.eventHandler()`

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

@ -41,7 +41,7 @@ static bool handleSyntheticKeyswitchEvent(Key mappedKey, uint8_t keyState) {
} else if (mappedKey.getFlags() & IS_INTERNAL) {
return false;
} else if (mappedKey.getFlags() & SWITCH_TO_KEYMAP) {
// Should not happen, handled elsewhere.
Layer.handleKeymapKeyswitchEvent(mappedKey, keyState);
}
return true;
@ -124,6 +124,5 @@ void handleKeyswitchEvent(Key mappedKey, KeyAddr key_addr, uint8_t keyState) {
return;
// Handle all built-in key types.
Layer.eventHandler(mappedKey, key_addr, keyState);
handleKeyswitchEventDefault(mappedKey, key_addr, keyState);
}

@ -111,6 +111,9 @@ class Layer_ {
}
static boolean isActive(uint8_t layer);
static void handleKeymapKeyswitchEvent(Key keymapEntry, uint8_t keyState);
DEPRECATED(LAYER_EVENTHANDLER)
static Key eventHandler(Key mappedKey, KeyAddr key_addr, uint8_t keyState);
typedef Key(*GetKeyFunction)(uint8_t layer, KeyAddr key_addr);
@ -137,8 +140,6 @@ class Layer_ {
static uint8_t active_layer_count_;
static int8_t active_layers_[31];
static uint8_t active_layer_keymap_[kaleidoscope_internal::device.numKeys()];
static void handleKeymapKeyswitchEvent(Key keymapEntry, uint8_t keyState);
};
}

@ -34,3 +34,7 @@
"keys at any given time. It is probably not necessary to directly\n" __NL__ \
"update that cache from a plugin, but if you need to, please use\n" __NL__ \
"the `live_keys.activate(key_addr, key)` function instead."
#define _DEPRECATED_MESSAGE_LAYER_EVENTHANDLER __NL__ \
"`Layer.eventHandler()` is deprecated.\n" __NL__ \
"Please use `Layer.handleKeymapKeyswitchEvent()` instead."

Loading…
Cancel
Save