This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
2016-09-17 18:31:14 +00:00
|
|
|
#ifndef KEY_LAYEREDCODESCBASE_H
|
|
|
|
#define KEY_LAYEREDCODESCBASE_H
|
2016-05-09 14:05:08 +00:00
|
|
|
#include <Arduino.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include "Code.h"
|
|
|
|
|
2016-09-17 18:31:14 +00:00
|
|
|
/* Class Key_LayeredCodeScBase is a 2-layer code, with one object for each layer e.g.
|
2016-05-09 14:05:08 +00:00
|
|
|
layer0: ms_up //mouse up
|
|
|
|
layer1: KEY_UP //up arrow
|
2016-05-28 21:16:32 +00:00
|
|
|
When the key is pressed, the active layer is retrieved from refLayerState,
|
2016-05-09 14:05:08 +00:00
|
|
|
and the object for the active layer is sent to USB.
|
|
|
|
*/
|
2016-09-17 18:31:14 +00:00
|
|
|
class Key_LayeredCodeScBase : public Code
|
2016-05-09 14:05:08 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
Code& refCode0;
|
|
|
|
const uint16_t scancode1;
|
|
|
|
protected:
|
|
|
|
bool layer;
|
|
|
|
public:
|
2016-09-17 18:31:14 +00:00
|
|
|
Key_LayeredCodeScBase(Code& refCode0, const uint16_t scancode1, uint8_t layer):
|
2016-05-09 14:05:08 +00:00
|
|
|
refCode0(refCode0), scancode1(scancode1), layer(layer) { }
|
|
|
|
virtual void press()=0;
|
|
|
|
virtual void release();
|
|
|
|
virtual void pressCode();
|
|
|
|
};
|
|
|
|
#endif
|