You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.7 KiB
70 lines
1.7 KiB
6 years ago
|
/* -*- mode: c++ -*-
|
||
|
* Kaleidoscope-Turbo
|
||
|
* Copyright (C) 2018 ash lea
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify it under
|
||
|
* the terms of the GNU General Public License as published by the Free Software
|
||
|
* Foundation, version 3.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||
|
* details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License along with
|
||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*/
|
||
|
|
||
|
#include <stdint.h>
|
||
5 years ago
|
#include "kaleidoscope/Runtime.h"
|
||
6 years ago
|
#include <Kaleidoscope-Ranges.h>
|
||
|
|
||
4 years ago
|
#pragma once
|
||
|
|
||
5 years ago
|
#define Key_Turbo Key{kaleidoscope::ranges::TURBO }
|
||
6 years ago
|
|
||
|
namespace kaleidoscope {
|
||
|
namespace plugin {
|
||
|
class Turbo : public kaleidoscope::Plugin {
|
||
|
public:
|
||
|
Turbo() {}
|
||
|
|
||
|
uint16_t interval();
|
||
|
void interval(uint16_t newVal);
|
||
|
|
||
|
uint16_t flashInterval();
|
||
|
void flashInterval(uint16_t newVal);
|
||
|
|
||
|
bool sticky();
|
||
|
void sticky(bool newVal);
|
||
|
|
||
|
bool flash();
|
||
|
void flash(bool newVal);
|
||
|
|
||
|
cRGB activeColor();
|
||
|
void activeColor(cRGB newVal);
|
||
|
|
||
|
EventHandlerResult onSetup();
|
||
|
EventHandlerResult onLayerChange();
|
||
6 years ago
|
EventHandlerResult onKeyswitchEvent(Key &key, KeyAddr key_addr, uint8_t key_state);
|
||
6 years ago
|
EventHandlerResult afterEachCycle();
|
||
|
private:
|
||
|
void findKeyPositions();
|
||
|
|
||
|
static uint16_t interval_;
|
||
|
static uint16_t flashInterval_;
|
||
|
static bool sticky_;
|
||
|
static bool flash_;
|
||
|
static cRGB activeColor_;
|
||
|
|
||
|
static bool enable;
|
||
|
static uint32_t startTime;
|
||
|
static uint32_t flashStartTime;
|
||
6 years ago
|
static KeyAddr keyPositions[4];
|
||
6 years ago
|
static uint16_t numKeys;
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
extern kaleidoscope::plugin::Turbo Turbo;
|