Kaleidoscope
Syster.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*-
2  * Kaleidoscope-Syster -- Symbolic input system
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 #include <Kaleidoscope-Ranges.h>
23 
24 #define SYSTER_MAX_SYMBOL_LENGTH 32
25 
26 #define SYSTER ((Key) { .raw = kaleidoscope::ranges::SYSTER })
27 
28 namespace kaleidoscope {
29 
30 class Syster : public KaleidoscopePlugin {
31  public:
32  typedef enum {
36  } action_t;
37 
38  Syster(void);
39 
40  void begin(void) final;
41  static void reset(void);
42 
43  private:
44  static char symbol_[SYSTER_MAX_SYMBOL_LENGTH + 1];
45  static uint8_t symbol_pos_;
46  static bool is_active_;
47 
48  static Key eventHandlerHook(Key mapped_key, byte row, byte col, uint8_t key_state);
49 };
50 };
51 
52 const char keyToChar(Key key);
53 void systerAction(kaleidoscope::Syster::action_t action, const char *symbol);
54 
#define SYSTER_MAX_SYMBOL_LENGTH
Definition: Syster.h:24
static void reset(void)
Definition: Syster.cpp:43
Definition: hid.cpp:4
Definition: Syster.h:35
byte byte col
Definition: TapDance.cpp:229
Definition: Syster.h:34
Definition: key_defs.h:13
Syster(void)
Definition: Syster.cpp:36
void systerAction(kaleidoscope::Syster::action_t action, const char *symbol)
action_t
Definition: Syster.h:32
Definition: Syster.h:33
Definition: Syster.h:30
Definition: Kaleidoscope.h:40
byte row
Definition: TapDance.cpp:229
const char keyToChar(Key key)
void begin(void) final
Definition: Syster.cpp:39