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_LAYERED2SCANCODES_H
|
|
|
|
#define KEY_LAYERED2SCANCODES_H
|
2016-05-09 14:05:08 +00:00
|
|
|
#include <Arduino.h>
|
|
|
|
#include <inttypes.h>
|
|
|
|
#include "Code.h"
|
|
|
|
|
2016-09-20 01:46:03 +00:00
|
|
|
/* Class Key_LayeredScScBase is an abstract base class for 2-layer keys:
|
|
|
|
if layerId=0, send scancode0
|
|
|
|
if layerId=1, send scancode1
|
2016-05-09 14:05:08 +00:00
|
|
|
*/
|
2016-09-17 18:31:14 +00:00
|
|
|
class Key_LayeredScScBase : public Code
|
2016-05-09 14:05:08 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
const uint16_t scancode0;
|
|
|
|
const uint16_t scancode1;
|
|
|
|
uint16_t scancode;
|
|
|
|
protected:
|
2016-09-20 01:46:03 +00:00
|
|
|
bool layerId; //active layer when key was pressed, 0 or 1
|
2016-05-09 14:05:08 +00:00
|
|
|
public:
|
2016-09-17 18:31:14 +00:00
|
|
|
Key_LayeredScScBase(const uint16_t scancode0, const uint16_t scancode1):
|
2016-09-20 01:46:03 +00:00
|
|
|
scancode0(scancode0), scancode1(scancode1), layerId(0) { }
|
2016-05-09 14:05:08 +00:00
|
|
|
virtual void press()=0;
|
|
|
|
virtual void release();
|
|
|
|
void pressScancode();
|
|
|
|
};
|
|
|
|
#endif
|