]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/common/command.h
Generate API docs from source code comments (#2491)
[qmk_firmware.git] / tmk_core / common / command.h
1 /*
2 Copyright 2011 Jun Wako <wakojun@gmail.com>
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef COMMAND_H
19 #define COMMAND
20
21 /* FIXME: Add doxygen comments for the behavioral defines in here. */
22
23 /* TODO: Refactoring */
24 typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t;
25 extern command_state_t command_state;
26
27 /* This allows to extend commands. Return false when command is not processed. */
28 bool command_extra(uint8_t code);
29 bool command_console_extra(uint8_t code);
30
31 #ifdef COMMAND_ENABLE
32 uint8_t numkey2num(uint8_t code);
33 bool command_proc(uint8_t code);
34 #else
35 #define command_proc(code)      false
36 #endif
37
38
39 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
40 #define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS  true
41 #endif
42
43 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
44 #define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS  true
45 #endif
46
47 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
48 #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
49 #endif
50
51 #ifndef MAGIC_KEY_HELP1
52 #define MAGIC_KEY_HELP1          H
53 #endif
54
55 #ifndef MAGIC_KEY_HELP2
56 #define MAGIC_KEY_HELP2          SLASH
57 #endif
58
59 #ifndef MAGIC_KEY_DEBUG
60 #define MAGIC_KEY_DEBUG          D
61 #endif
62
63 #ifndef MAGIC_KEY_DEBUG_MATRIX
64 #define MAGIC_KEY_DEBUG_MATRIX   X
65 #endif
66
67 #ifndef MAGIC_KEY_DEBUG_KBD
68 #define MAGIC_KEY_DEBUG_KBD      K
69 #endif
70
71 #ifndef MAGIC_KEY_DEBUG_MOUSE
72 #define MAGIC_KEY_DEBUG_MOUSE    M
73 #endif
74
75 #ifndef MAGIC_KEY_VERSION
76 #define MAGIC_KEY_VERSION        V
77 #endif
78
79 #ifndef MAGIC_KEY_STATUS
80 #define MAGIC_KEY_STATUS         S
81 #endif
82
83 #ifndef MAGIC_KEY_CONSOLE
84 #define MAGIC_KEY_CONSOLE        C
85 #endif
86
87 #ifndef MAGIC_KEY_LAYER0_ALT1
88 #define MAGIC_KEY_LAYER0_ALT1    ESC
89 #endif
90
91 #ifndef MAGIC_KEY_LAYER0_ALT2
92 #define MAGIC_KEY_LAYER0_ALT2    GRAVE
93 #endif
94
95 #ifndef MAGIC_KEY_LAYER0
96 #define MAGIC_KEY_LAYER0         0
97 #endif
98
99 #ifndef MAGIC_KEY_LAYER1
100 #define MAGIC_KEY_LAYER1         1
101 #endif
102
103 #ifndef MAGIC_KEY_LAYER2
104 #define MAGIC_KEY_LAYER2         2
105 #endif
106
107 #ifndef MAGIC_KEY_LAYER3
108 #define MAGIC_KEY_LAYER3         3
109 #endif
110
111 #ifndef MAGIC_KEY_LAYER4
112 #define MAGIC_KEY_LAYER4         4
113 #endif
114
115 #ifndef MAGIC_KEY_LAYER5
116 #define MAGIC_KEY_LAYER5         5
117 #endif
118
119 #ifndef MAGIC_KEY_LAYER6
120 #define MAGIC_KEY_LAYER6         6
121 #endif
122
123 #ifndef MAGIC_KEY_LAYER7
124 #define MAGIC_KEY_LAYER7         7
125 #endif
126
127 #ifndef MAGIC_KEY_LAYER8
128 #define MAGIC_KEY_LAYER8         8
129 #endif
130
131 #ifndef MAGIC_KEY_LAYER9
132 #define MAGIC_KEY_LAYER9         9
133 #endif
134
135 #ifndef MAGIC_KEY_BOOTLOADER
136 #define MAGIC_KEY_BOOTLOADER     PAUSE
137 #endif
138
139 #ifndef MAGIC_KEY_LOCK
140 #define MAGIC_KEY_LOCK           CAPS
141 #endif
142
143 #ifndef MAGIC_KEY_EEPROM
144 #define MAGIC_KEY_EEPROM         E
145 #endif
146
147 #ifndef MAGIC_KEY_NKRO
148 #define MAGIC_KEY_NKRO           N
149 #endif
150
151 #ifndef MAGIC_KEY_SLEEP_LED
152 #define MAGIC_KEY_SLEEP_LED      Z
153
154 #endif
155
156 #define XMAGIC_KC(key) KC_##key
157 #define MAGIC_KC(key) XMAGIC_KC(key)
158
159 #endif