Archived
1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
keybrd/src/LayerState.cpp
2016-07-17 20:03:03 -06:00

33 lines
610 B
C++

#include "LayerState.h"
void LayerState::hold(const uint8_t layer)
{
setActiveLayer(layer);
}
void LayerState::unhold(const uint8_t layer)
{
if (layer == activeLayer);
{
setActiveLayer(lockedLayer);
}
}
void LayerState::lock(const uint8_t layer)
{
setActiveLayer(layer);
lockedLayer = layer;
}
/*Derived classes override setActiveLayer() to also set LED indicator lights e.g. LayerState_LED
*/
void LayerState::setActiveLayer(const uint8_t layer)
{
activeLayer = layer;
}
uint8_t LayerState::getActiveLayer()
{
return activeLayer;
}