Kaleidoscope
Kaleidoscope-Macros.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Kaleidoscope.h>
4 
5 #include "MacroKeyDefs.h"
6 #include "MacroSteps.h"
7 
8 const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState);
9 
10 class Macros_ : public KaleidoscopePlugin {
11  public:
12  Macros_(void);
13 
14  void begin(void) final;
15 
16  void play(const macro_t *macro_p);
17 
18  /* What follows below, is a bit of template magic that allows us to use
19  Macros.type() with any number of arguments, without having to use a
20  sentinel. See the comments on Kaleidoscope.use() for more details - this is
21  the same trick.
22  */
23  inline const macro_t *type() {
24  return MACRO_NONE;
25  }
26  const macro_t *type(const char *string);
27  template <typename... Strings>
28  const macro_t *type(const char *first, Strings&&... strings) {
29  type(first);
30  return type(strings...);
31  }
32 
33  static byte row, col;
34 
35  private:
36  Key lookupAsciiCode(uint8_t ascii_code);
37 };
38 
39 extern Macros_ Macros;
void begin(void) final
Definition: Kaleidoscope-Macros.cpp:200
uint8_t macro_t
Definition: MacroSteps.h:18
Macros_ Macros
Definition: Kaleidoscope-Macros.cpp:204
Macros_(void)
Definition: Kaleidoscope-Macros.cpp:196
const macro_t * macroAction(uint8_t macroIndex, uint8_t keyState)
static byte col
Definition: Kaleidoscope-Macros.h:33
const macro_t * type()
Definition: Kaleidoscope-Macros.h:23
Definition: key_defs.h:13
void play(const macro_t *macro_p)
Definition: Kaleidoscope-Macros.cpp:29
#define MACRO_NONE
Definition: MacroSteps.h:20
const macro_t * type(const char *first, Strings &&... strings)
Definition: Kaleidoscope-Macros.h:28
Definition: Kaleidoscope.h:40
static byte row
Definition: Kaleidoscope-Macros.h:33
uint8_t keyState
Definition: Kaleidoscope-Macros.cpp:5
Definition: Kaleidoscope-Macros.h:10