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/>.
20 /* FIXME: Add doxygen comments for the behavioral defines in here. */
22 /* TODO: Refactoring */
23 typedef enum { ONESHOT, CONSOLE, MOUSEKEY } command_state_t;
24 extern command_state_t command_state;
26 /* This allows to extend commands. Return false when command is not processed. */
27 bool command_extra(uint8_t code);
28 bool command_console_extra(uint8_t code);
31 uint8_t numkey2num(uint8_t code);
32 bool command_proc(uint8_t code);
34 #define command_proc(code) false
38 #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
41 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
42 #define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
45 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
46 #define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
49 #ifndef MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
50 #define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
53 #ifndef MAGIC_KEY_HELP
54 #define MAGIC_KEY_HELP H
57 #ifndef MAGIC_KEY_HELP_ALT
58 #define MAGIC_KEY_HELP_ALT SLASH
61 #ifndef MAGIC_KEY_DEBUG
62 #define MAGIC_KEY_DEBUG D
65 #ifndef MAGIC_KEY_DEBUG_MATRIX
66 #define MAGIC_KEY_DEBUG_MATRIX X
69 #ifndef MAGIC_KEY_DEBUG_KBD
70 #define MAGIC_KEY_DEBUG_KBD K
73 #ifndef MAGIC_KEY_DEBUG_MOUSE
74 #define MAGIC_KEY_DEBUG_MOUSE M
77 #ifndef MAGIC_KEY_VERSION
78 #define MAGIC_KEY_VERSION V
81 #ifndef MAGIC_KEY_STATUS
82 #define MAGIC_KEY_STATUS S
85 #ifndef MAGIC_KEY_CONSOLE
86 #define MAGIC_KEY_CONSOLE C
89 #ifndef MAGIC_KEY_LAYER0
90 #define MAGIC_KEY_LAYER0 0
93 #ifndef MAGIC_KEY_LAYER0_ALT
94 #define MAGIC_KEY_LAYER0_ALT GRAVE
97 #ifndef MAGIC_KEY_LAYER1
98 #define MAGIC_KEY_LAYER1 1
101 #ifndef MAGIC_KEY_LAYER2
102 #define MAGIC_KEY_LAYER2 2
105 #ifndef MAGIC_KEY_LAYER3
106 #define MAGIC_KEY_LAYER3 3
109 #ifndef MAGIC_KEY_LAYER4
110 #define MAGIC_KEY_LAYER4 4
113 #ifndef MAGIC_KEY_LAYER5
114 #define MAGIC_KEY_LAYER5 5
117 #ifndef MAGIC_KEY_LAYER6
118 #define MAGIC_KEY_LAYER6 6
121 #ifndef MAGIC_KEY_LAYER7
122 #define MAGIC_KEY_LAYER7 7
125 #ifndef MAGIC_KEY_LAYER8
126 #define MAGIC_KEY_LAYER8 8
129 #ifndef MAGIC_KEY_LAYER9
130 #define MAGIC_KEY_LAYER9 9
133 #ifndef MAGIC_KEY_BOOTLOADER
134 #define MAGIC_KEY_BOOTLOADER B
137 #ifndef MAGIC_KEY_BOOTLOADER_ALT
138 #define MAGIC_KEY_BOOTLOADER_ALT ESC
141 #ifndef MAGIC_KEY_LOCK
142 #define MAGIC_KEY_LOCK CAPS
145 #ifndef MAGIC_KEY_EEPROM
146 #define MAGIC_KEY_EEPROM E
149 #ifndef MAGIC_KEY_EEPROM_CLEAR
150 #define MAGIC_KEY_EEPROM_CLEAR BSPACE
153 #ifndef MAGIC_KEY_NKRO
154 #define MAGIC_KEY_NKRO N
157 #ifndef MAGIC_KEY_SLEEP_LED
158 #define MAGIC_KEY_SLEEP_LED Z
162 #define XMAGIC_KC(key) KC_ ## key
163 #define MAGIC_KC(key) XMAGIC_KC(key)