]> git.donarmstrong.com Git - qmk_firmware.git/blob - tmk_core/common/command.h
Merge remote-tracking branch 'jackhumbert/master' into improve-buildguide
[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 /* TODO: Refactoring */
22 typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t;
23 extern command_state_t command_state;
24
25 /* This allows to extend commands. Return false when command is not processed. */
26 bool command_extra(uint8_t code);
27 bool command_console_extra(uint8_t code);
28
29 #ifdef COMMAND_ENABLE
30 bool command_proc(uint8_t code);
31 #else
32 #define command_proc(code)      false
33 #endif
34
35
36 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
37 #define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS  true
38 #endif
39
40 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
41 #define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS  true
42 #endif
43
44 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
45 #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
46 #endif
47
48 #ifndef MAGIC_KEY_HELP1
49 #define MAGIC_KEY_HELP1          H
50 #endif
51
52 #ifndef MAGIC_KEY_HELP2
53 #define MAGIC_KEY_HELP2          SLASH
54 #endif
55
56 #ifndef MAGIC_KEY_DEBUG
57 #define MAGIC_KEY_DEBUG          D
58 #endif
59
60 #ifndef MAGIC_KEY_DEBUG_MATRIX
61 #define MAGIC_KEY_DEBUG_MATRIX   X
62 #endif
63
64 #ifndef MAGIC_KEY_DEBUG_KBD
65 #define MAGIC_KEY_DEBUG_KBD      K
66 #endif
67
68 #ifndef MAGIC_KEY_DEBUG_MOUSE
69 #define MAGIC_KEY_DEBUG_MOUSE    M
70 #endif
71
72 #ifndef MAGIC_KEY_VERSION
73 #define MAGIC_KEY_VERSION        V
74 #endif
75
76 #ifndef MAGIC_KEY_STATUS
77 #define MAGIC_KEY_STATUS         S
78 #endif
79
80 #ifndef MAGIC_KEY_CONSOLE
81 #define MAGIC_KEY_CONSOLE        C
82 #endif
83
84 #ifndef MAGIC_KEY_LAYER0_ALT1
85 #define MAGIC_KEY_LAYER0_ALT1    ESC
86 #endif
87
88 #ifndef MAGIC_KEY_LAYER0_ALT2
89 #define MAGIC_KEY_LAYER0_ALT2    GRAVE
90 #endif
91
92 #ifndef MAGIC_KEY_LAYER0
93 #define MAGIC_KEY_LAYER0         0
94 #endif
95
96 #ifndef MAGIC_KEY_LAYER1
97 #define MAGIC_KEY_LAYER1         1
98 #endif
99
100 #ifndef MAGIC_KEY_LAYER2
101 #define MAGIC_KEY_LAYER2         2
102 #endif
103
104 #ifndef MAGIC_KEY_LAYER3
105 #define MAGIC_KEY_LAYER3         3
106 #endif
107
108 #ifndef MAGIC_KEY_LAYER4
109 #define MAGIC_KEY_LAYER4         4
110 #endif
111
112 #ifndef MAGIC_KEY_LAYER5
113 #define MAGIC_KEY_LAYER5         5
114 #endif
115
116 #ifndef MAGIC_KEY_LAYER6
117 #define MAGIC_KEY_LAYER6         6
118 #endif
119
120 #ifndef MAGIC_KEY_LAYER7
121 #define MAGIC_KEY_LAYER7         7
122 #endif
123
124 #ifndef MAGIC_KEY_LAYER8
125 #define MAGIC_KEY_LAYER8         8
126 #endif
127
128 #ifndef MAGIC_KEY_LAYER9
129 #define MAGIC_KEY_LAYER9         9
130 #endif
131
132 #ifndef MAGIC_KEY_BOOTLOADER
133 #define MAGIC_KEY_BOOTLOADER     PAUSE
134 #endif
135
136 #ifndef MAGIC_KEY_LOCK
137 #define MAGIC_KEY_LOCK           CAPS
138 #endif
139
140 #ifndef MAGIC_KEY_EEPROM
141 #define MAGIC_KEY_EEPROM         E
142 #endif
143
144 #ifndef MAGIC_KEY_NKRO
145 #define MAGIC_KEY_NKRO           N
146 #endif
147
148 #ifndef MAGIC_KEY_SLEEP_LED
149 #define MAGIC_KEY_SLEEP_LED      Z
150
151 #endif
152
153 #define XMAGIC_KC(key) KC_##key
154 #define MAGIC_KC(key) XMAGIC_KC(key)
155
156 #endif