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.
51 lines
1.4 KiB
51 lines
1.4 KiB
8 years ago
|
/* -*- mode: c++ -*-
|
||
|
* Kaleidoscope-FingerPainter -- On-the-fly keyboard painting.
|
||
6 years ago
|
* Copyright (C) 2017, 2018 Keyboard.io, Inc
|
||
8 years ago
|
*
|
||
6 years ago
|
* 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.
|
||
8 years ago
|
*
|
||
6 years ago
|
* 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.
|
||
8 years ago
|
*
|
||
6 years ago
|
* You should have received a copy of the GNU General Public License along with
|
||
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||
8 years ago
|
*/
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <Kaleidoscope-LEDControl.h>
|
||
|
|
||
8 years ago
|
namespace kaleidoscope {
|
||
6 years ago
|
namespace plugin {
|
||
6 years ago
|
|
||
|
// This class is implemented as a persistent LED mode
|
||
|
// as there is no benefit of transforming it into a dynamic
|
||
|
// LED mode in terms of PROGMEM or RAM.
|
||
|
//
|
||
8 years ago
|
class FingerPainter : public LEDMode {
|
||
8 years ago
|
public:
|
||
7 years ago
|
FingerPainter(void) {}
|
||
8 years ago
|
|
||
8 years ago
|
static void toggle(void);
|
||
8 years ago
|
|
||
6 years ago
|
EventHandlerResult onKeyswitchEvent(Key &mapped_key, KeyAddr key_addr, uint8_t key_state);
|
||
6 years ago
|
EventHandlerResult onFocusEvent(const char *command);
|
||
7 years ago
|
EventHandlerResult onSetup();
|
||
|
|
||
7 years ago
|
protected:
|
||
|
void update(void) final;
|
||
6 years ago
|
void refreshAt(KeyAddr key_addr) final;
|
||
7 years ago
|
|
||
8 years ago
|
private:
|
||
8 years ago
|
static uint16_t color_base_;
|
||
|
static bool edit_mode_;
|
||
8 years ago
|
};
|
||
6 years ago
|
}
|
||
|
}
|
||
8 years ago
|
|
||
6 years ago
|
extern kaleidoscope::plugin::FingerPainter FingerPainter;
|