Arhivēts
1
0
Šis repozitorijs ir arhivēts. Ir iespējams aplūkot tā failus un to konēt, bet nav iespējams iesūtīt izmaiņas, kā arī izveidot jaunas problēmas vai izmaiņu pieprasījumus.
keybrd/src/LayerState.cpp

33 rindas
629 B
C++

2016-05-28 21:16:32 +00:00
#include "LayerState.h"
2016-05-09 14:05:08 +00:00
2016-09-20 01:46:03 +00:00
void LayerState::hold(const uint8_t layerId)
2016-05-09 14:05:08 +00:00
{
2016-09-20 01:46:03 +00:00
setActiveLayer(layerId);
2016-05-09 14:05:08 +00:00
}
2016-09-20 01:46:03 +00:00
void LayerState::unhold(const uint8_t layerId)
2016-05-09 14:05:08 +00:00
{
2016-09-20 01:46:03 +00:00
if (layerId == activeLayer);
2016-05-09 14:05:08 +00:00
{
setActiveLayer(lockedLayer);
}
}
2016-09-20 01:46:03 +00:00
void LayerState::lock(const uint8_t layerId)
2016-05-09 14:05:08 +00:00
{
2016-09-20 01:46:03 +00:00
setActiveLayer(layerId);
lockedLayer = layerId;
2016-05-09 14:05:08 +00:00
}
/* Derived classes override setActiveLayer() to also set LED indicator lights e.g. LayerState_LED
2016-07-18 02:03:03 +00:00
*/
2016-09-20 01:46:03 +00:00
void LayerState::setActiveLayer(const uint8_t layerId)
2016-05-09 14:05:08 +00:00
{
2016-09-20 01:46:03 +00:00
activeLayer = layerId;
2016-05-09 14:05:08 +00:00
}
2016-05-28 21:16:32 +00:00
uint8_t LayerState::getActiveLayer()
2016-05-09 14:05:08 +00:00
{
return activeLayer;
}