Este repositorio está archivado. Usted puede ver los archivos y clonarlos, pero no puede hace push o abrir incidencias o pull requests.
2016-11-17 06:28:37 +00:00
|
|
|
#ifndef CODE_LAYERHOLDSHIFT_H
|
|
|
|
#define CODE_LAYERHOLDSHIFT_H
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
2016-11-18 10:21:50 +00:00
|
|
|
#include "Code.h"
|
|
|
|
#include "LayerState.h"
|
|
|
|
#include "Code_Shift.h"
|
2016-11-17 06:28:37 +00:00
|
|
|
|
|
|
|
/* Code_LayerHoldShift calls LayerState when pressed to change activeLayer.
|
|
|
|
When a Code_LayerHoldShift object is pressed or released, it:
|
|
|
|
* sends scancode in refCodeShift
|
|
|
|
* calls LayerState to change activeLayer
|
|
|
|
|
|
|
|
Codes defined in sketch would be Code_Sc and Code_ScNS
|
|
|
|
(Code_ScS is not need because refCodeShift sends the shift scancode).
|
|
|
|
*/
|
|
|
|
class Code_LayerHoldShift : public Code
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
const uint8_t layerId;
|
|
|
|
LayerState& refLayerState;
|
|
|
|
Code_Shift& refCodeShift;
|
|
|
|
public:
|
|
|
|
Code_LayerHoldShift(const uint8_t layerId, LayerState& refLayerState,
|
|
|
|
Code_Shift& refCodeShift)
|
|
|
|
: layerId(layerId), refLayerState(refLayerState),
|
|
|
|
refCodeShift(refCodeShift) {}
|
|
|
|
virtual void press();
|
|
|
|
virtual void release();
|
|
|
|
};
|
|
|
|
#endif
|