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

32 lines
587 B
C++
Raw Normal View History

2016-05-28 21:16:32 +00:00
#include "LayerState.h"
2016-05-09 14:05:08 +00:00
2016-05-28 21:16:32 +00:00
void LayerState::hold(const uint8_t layer)
2016-05-09 14:05:08 +00:00
{
setActiveLayer(layer);
}
2016-05-28 21:16:32 +00:00
void LayerState::unhold(const uint8_t layer)
2016-05-09 14:05:08 +00:00
{
if (layer == activeLayer);
{
setActiveLayer(lockedLayer);
}
}
2016-05-28 21:16:32 +00:00
void LayerState::lock(const uint8_t layer)
2016-05-09 14:05:08 +00:00
{
setActiveLayer(layer);
lockedLayer = layer;
}
2016-05-19 17:51:57 +00:00
//Derived classes override setActiveLayer() to also set LED indicator lights.
2016-05-28 21:16:32 +00:00
void LayerState::setActiveLayer(const uint8_t layer)
2016-05-09 14:05:08 +00:00
{
activeLayer = layer;
}
2016-05-28 21:16:32 +00:00
uint8_t LayerState::getActiveLayer()
2016-05-09 14:05:08 +00:00
{
return activeLayer;
}