Kaleidoscope
GhostInTheFirmware.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*-
2  * Kaleidoscope-GhostInTheFirmware -- Let the keyboard write for you!
3  * Copyright (C) 2017 Gergely Nagy
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #include <Kaleidoscope.h>
22 
23 namespace kaleidoscope {
25  public:
26  typedef struct {
27  byte row;
28  byte col;
29  uint16_t pressTime;
30  uint16_t delay;
31  } GhostKey;
32  static const GhostKey *ghost_keys;
33 
34  GhostInTheFirmware(void);
35 
36  void begin(void) final;
37  static void activate(void);
38 
39  private:
40  static bool is_active_;
41  static bool is_pressed_;
42  static uint16_t current_pos_;
43  static uint32_t start_time_;
44  static uint16_t press_timeout_;
45  static uint16_t delay_timeout_;
46 
47  static void loopHook(bool is_post_clear);
48 };
49 }
50 
uint16_t pressTime
Definition: GhostInTheFirmware.h:29
byte row
Definition: GhostInTheFirmware.h:27
void begin(void) final
Definition: GhostInTheFirmware.cpp:34
Definition: hid.cpp:4
byte col
Definition: GhostInTheFirmware.h:28
uint16_t delay
Definition: GhostInTheFirmware.h:30
static void activate(void)
Definition: GhostInTheFirmware.cpp:38
Definition: Kaleidoscope.h:40
static const GhostKey * ghost_keys
Definition: GhostInTheFirmware.h:32
Definition: GhostInTheFirmware.h:24
Definition: GhostInTheFirmware.h:26
GhostInTheFirmware(void)
Definition: GhostInTheFirmware.cpp:31