|
|
|
@ -10,8 +10,8 @@ Key(*Layer_::getKey)(uint8_t layer, byte row, byte col) = Layer.getKeyFromPROGME
|
|
|
|
|
|
|
|
|
|
// The total number of defined layers in the firmware sketch keymaps[]
|
|
|
|
|
// array. If the keymap wasn't defined using CREATE_KEYMAP() in the
|
|
|
|
|
// sketch file, LayerCount gets the default value of zero.
|
|
|
|
|
uint8_t LayerCount __attribute__((weak)) = 0;
|
|
|
|
|
// sketch file, layer_count gets the default value of zero.
|
|
|
|
|
uint8_t layer_count __attribute__((weak)) = 0;
|
|
|
|
|
|
|
|
|
|
static void handleKeymapKeyswitchEvent(Key keymapEntry, uint8_t keyState) {
|
|
|
|
|
if (keymapEntry.keyCode >= LAYER_SHIFT_OFFSET) {
|
|
|
|
@ -132,7 +132,7 @@ void Layer_::move(uint8_t layer) {
|
|
|
|
|
void Layer_::on(uint8_t layer) {
|
|
|
|
|
// If we're trying to turn on a layer that doesn't exist, abort (but
|
|
|
|
|
// if the keymap wasn't defined using CREATE_KEYMAP(), proceed anyway
|
|
|
|
|
if (LayerCount != 0 && layer >= LayerCount)
|
|
|
|
|
if (layer_count != 0 && layer >= layer_count)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
bool wasOn = isOn(layer);
|
|
|
|
|