Deprecate `Layer.eventHandler()`

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
f/keymap-cache-redesign
Michael Richters 4 years ago committed by Jesse Vincent
parent 38c18cdcc7
commit 60d1e2faaf
No known key found for this signature in database
GPG Key ID: 122F5DF7108E4046

@ -40,7 +40,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;
@ -139,6 +139,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);
}

@ -121,6 +121,9 @@ class Layer_ {
return layer_state_;
}
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);
@ -147,8 +150,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);
};
}

@ -53,3 +53,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 `Runtime.updateActiveKey(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