2 Copyright 2011 Jun Wako <wakojun@gmail.com>
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.
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.
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/>.
21 /* FIXME: Add doxygen comments for the behavioral defines in here. */
23 /* TODO: Refactoring */
24 typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t;
25 extern command_state_t command_state;
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);
32 uint8_t numkey2num(uint8_t code);
33 bool command_proc(uint8_t code);
35 #define command_proc(code) false
39 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
40 #define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
43 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
44 #define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
47 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
48 #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
51 #ifndef MAGIC_KEY_HELP1
52 #define MAGIC_KEY_HELP1 H
55 #ifndef MAGIC_KEY_HELP2
56 #define MAGIC_KEY_HELP2 SLASH
59 #ifndef MAGIC_KEY_DEBUG
60 #define MAGIC_KEY_DEBUG D
63 #ifndef MAGIC_KEY_DEBUG_MATRIX
64 #define MAGIC_KEY_DEBUG_MATRIX X
67 #ifndef MAGIC_KEY_DEBUG_KBD
68 #define MAGIC_KEY_DEBUG_KBD K
71 #ifndef MAGIC_KEY_DEBUG_MOUSE
72 #define MAGIC_KEY_DEBUG_MOUSE M
75 #ifndef MAGIC_KEY_VERSION
76 #define MAGIC_KEY_VERSION V
79 #ifndef MAGIC_KEY_STATUS
80 #define MAGIC_KEY_STATUS S
83 #ifndef MAGIC_KEY_CONSOLE
84 #define MAGIC_KEY_CONSOLE C
87 #ifndef MAGIC_KEY_LAYER0_ALT1
88 #define MAGIC_KEY_LAYER0_ALT1 ESC
91 #ifndef MAGIC_KEY_LAYER0_ALT2
92 #define MAGIC_KEY_LAYER0_ALT2 GRAVE
95 #ifndef MAGIC_KEY_LAYER0
96 #define MAGIC_KEY_LAYER0 0
99 #ifndef MAGIC_KEY_LAYER1
100 #define MAGIC_KEY_LAYER1 1
103 #ifndef MAGIC_KEY_LAYER2
104 #define MAGIC_KEY_LAYER2 2
107 #ifndef MAGIC_KEY_LAYER3
108 #define MAGIC_KEY_LAYER3 3
111 #ifndef MAGIC_KEY_LAYER4
112 #define MAGIC_KEY_LAYER4 4
115 #ifndef MAGIC_KEY_LAYER5
116 #define MAGIC_KEY_LAYER5 5
119 #ifndef MAGIC_KEY_LAYER6
120 #define MAGIC_KEY_LAYER6 6
123 #ifndef MAGIC_KEY_LAYER7
124 #define MAGIC_KEY_LAYER7 7
127 #ifndef MAGIC_KEY_LAYER8
128 #define MAGIC_KEY_LAYER8 8
131 #ifndef MAGIC_KEY_LAYER9
132 #define MAGIC_KEY_LAYER9 9
135 #ifndef MAGIC_KEY_BOOTLOADER
136 #define MAGIC_KEY_BOOTLOADER PAUSE
139 #ifndef MAGIC_KEY_LOCK
140 #define MAGIC_KEY_LOCK CAPS
143 #ifndef MAGIC_KEY_EEPROM
144 #define MAGIC_KEY_EEPROM E
147 #ifndef MAGIC_KEY_NKRO
148 #define MAGIC_KEY_NKRO N
151 #ifndef MAGIC_KEY_SLEEP_LED
152 #define MAGIC_KEY_SLEEP_LED Z
156 #define XMAGIC_KC(key) KC_##key
157 #define MAGIC_KC(key) XMAGIC_KC(key)