3 Something important to realise with keycodes is that they are all numbers between `0x0` and `0xFFFF` - even though they may look like functions, words, or phrases, they are all shortcuts to some number. This allows us to define all of what they do in different places, and store keymaps in a relatively small place (arrays). If you try to "call" a keycode by placing it somewhere besides a keymap, it may compile, but it won't do anything useful.
5 All keycodes on this page have a value above `0xFF` (values less are considered the [basic keycodes](basic_keycodes.md)) and won't work with any of the mod/layer-tap keys listed at the bottom.
7 * `SAFE_RANGE` is always the last keycode in the quantum list, and where custom lists can begin
8 * `RESET` puts the keyboard into DFU mode for flashing
9 * `DEBUG` toggles debug mode
10 * Shortcuts for bootmagic options (work when bootmagic is off)
11 * `MAGIC_SWAP_CONTROL_CAPSLOCK`
12 * `MAGIC_CAPSLOCK_TO_CONTROL`
13 * `MAGIC_SWAP_LALT_LGUI`
14 * `MAGIC_SWAP_RALT_RGUI`
16 * `MAGIC_SWAP_GRAVE_ESC`
17 * `MAGIC_SWAP_BACKSLASH_BACKSPACE`
19 * `MAGIC_SWAP_ALT_GUI`/`AG_SWAP`
20 * `MAGIC_UNSWAP_CONTROL_CAPSLOCK`
21 * `MAGIC_UNCAPSLOCK_TO_CONTROL`
22 * `MAGIC_UNSWAP_LALT_LGUI`
23 * `MAGIC_UNSWAP_RALT_RGUI`
25 * `MAGIC_UNSWAP_GRAVE_ESC`
26 * `MAGIC_UNSWAP_BACKSLASH_BACKSPACE`
28 * `MAGIC_UNSWAP_ALT_GUI`/`AG_NORM`
30 * `KC_GESC`/`GRAVE_ESC` acts as escape when pressed normally but when pressed with a mod will send a `~`
31 * `KC_LSPO` left shift when held, open paranthesis when tapped
32 * `KC_RSPC` right shift when held, close paranthesis when tapped
33 * `KC_LEAD` the leader key
35 * `FUNC(n)`/`F(n)` to call `fn_action` n
36 * `M(n)` to call macro n
37 * `MACROTAP(n)` to macro-tap n idk FIXME
47 #ifdef FAUXCLICKY_ENABLE
53 // Music mode on/off/toggle
58 // Music voice iterate
66 #if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
67 MI_ON, // send midi notes when music mode is enabled
68 MI_OFF, // don't send midi notes when music mode is enabled
92 MIDI_TONE_KEYCODE_OCTAVES > 1
115 MIDI_OCTAVE_MIN = MI_OCT_N2,
116 MIDI_OCTAVE_MAX = MI_OCT_7,
117 MI_OCTD, // octave down
118 MI_OCTU, // octave up
122 MIDI_TRANSPOSE_MIN = MI_TRNS_N6,
123 MIDI_TRANSPOSE_MAX = MI_TRNS_6,
124 MI_TRNSD, // transpose down
125 MI_TRNSU, // transpose up
128 MIDI_VELOCITY_MIN = MI_VEL_1,
129 MIDI_VELOCITY_MAX = MI_VEL_10,
130 MI_VELD, // velocity down
131 MI_VELU, // velocity up
134 MIDI_CHANNEL_MIN = MI_CH1
135 MIDI_CHANNEL_MAX = MI_CH16,
136 MI_CHD, // previous channel
137 MI_CHU, // next channel
139 MI_ALLOFF, // all notes off
142 MI_PORT, // portamento
143 MI_SOST, // sostenuto
144 MI_SOFT, // soft pedal
147 MI_MOD, // modulation
148 MI_MODSD, // decrease modulation speed
149 MI_MODSU, // increase modulation speed
150 #endif // MIDI_ADVANCED
154 * `BL_x` where x = 0-15
164 * `RGB_TOG` toggle on/off
165 * `RGB_MOD` cycle between modes
166 * `RGB_HUI` hue increase
167 * `RGB_HUD` hue decrease
168 * `RGB_SAI` saturation increase
169 * `RGB_SAD` saturation decrease
170 * `RGB_VAI` value increase
171 * `RGB_VAD` value decrease
173 ## Thermal Printer (experimental)
178 ## Keyboard output selection
180 * `OUT_AUTO` auto mode
182 * `OUT_BT` bluetooth (when `BLUETOOTH_ENABLE`)
186 * `KC_HYPR` LCTL + LSFT + LALT + LGUI - `MOD_HYPR` is the bit version
187 * `KC_MEH` LCTL + LSFT + LALT - `MOD_MEH` is the bit version
189 ### Modifiers with keys
191 * `LCTL(kc)` LCTL + kc
192 * `LSFT(kc)`/`S(kc)` LSFT + kc
193 * `LALT(kc)` LALT + kc
194 * `LGUI(kc)` LGUI + kc
195 * `RCTL(kc)` RCTL + kc
196 * `RSFT(kc)` RSFT + kc
197 * `RALT(kc)` RALT + kc
198 * `RGUI(kc)` RGUI + kc
200 * `HYPR(kc)` LCTL + LSFT + LALT + LGUI + kc
201 * `MEH(kc)` LCTL + LSFT + LALT + kc
202 * `LCAG(kc)` LCTL + LALT + LGUI + kc
203 * `ALTG(kc)` RCTL + RALT + kc
204 * `SCMD(kc)`/`SWIN(kc)` LGUI + LSFT + kc
205 * `LCA(kc)` LCTL + LALT + kc
207 * `OSM(mod)` use mod for one keypress - use mod bits with this
209 > Mod bits are the 4-letter part of the keycode prefixed with `MOD_`, e.g. `MOD_LCTL`
213 These keycodes will press the mod(s) when held, and the key when tapped. They only work with [basic keycodes](basic_keycodes.md).
215 * `CTL_T(kc)`/`LCTL_T(kc)` LCTL when held, kc when tapped
216 * `RCTL_T(kc)` RCTL when held, kc when tapped
218 * `SFT_T(kc)`/`LSFT_T(kc)` LSFT when held, kc when tapped
219 * `RSFT_T(kc)` RSFT when held, kc when tapped
221 * `ALT_T(kc)`/`LALT_T(kc)` LALT when held, kc when tapped
222 * `RALT_T(kc)`/`ALGR_T(kc)` RALT when held, kc when tapped
224 * `GUI_T(kc)`/`LGUI_T(kc)` LGUI when held, kc when tapped
225 * `RGUI_T(kc)` RGUI when held, kc when tapped
227 * `C_S_T(kc)` LCTL + LSFT when held, kc when tapped
228 * `MEH_T(kc)` LCTL + LSFT + LALT when held, kc when tapped
229 * `LCAG_T(kc)` LCTL + LALT + LGUI when held, kc when tapped
230 * `RCAG_T(kc)` RCTL + RALT + RGUI when held, kc when tapped
231 * `ALL_T(kc)` LCTL + LSFT + LALT + LGUI when held, kc tapped [more info](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)
232 * `SCMD_T(kc)`/`SWIN_T(kc)` LGUI + LSFT when held, kc when tapped
233 * `LCA_T(kc)` LCTL + LALT when held, kc when tapped
237 It's important to remember that all of the keycodes also send a left shift - this may cause unintended actions if unaccounted for. The 4-letter code is preferred in most situations.
239 * `KC_TILD`/`KC_TILDE` tilde `~`
240 * `KC_EXLM`/`KC_EXCLAIM` exclamation mark `!`
241 * `KC_AT` at sign `@`
242 * `KC_HASH` hash sign `#`
243 * `KC_DLR`/`KC_DOLLAR` dollar sign `$`
244 * `KC_PERC`/`KC_PERCENT` percent sign `%`
245 * `KC_CIRC`/`KC_CIRCUMFLEX` circumflex `^`
246 * `KC_AMPR`/`KC_AMPERSAND` ampersand `&`
247 * `KC_ASTR`/`KC_ASTERISK` asterisk `*`
248 * `KC_LPRN`/`KC_LEFT_PAREN` left parenthesis `(`
249 * `KC_RPRN`/`KC_RIGHT_PAREN` right parenthesis `)`
250 * `KC_UNDS`/`KC_UNDERSCORE` underscore `_`
251 * `KC_PLUS` plus sign `+`
252 * `KC_LCBR`/`KC_LEFT_CURLY_BRACE` left curly brace `{`
253 * `KC_RCBR`/`KC_RIGHT_CURLY_BRACE` right curly brace `}`
254 * `KC_LT`/`KC_LABK`/`KC_LEFT_ANGLE_BRACKET` left angle bracket `<`
255 * `KC_GT`/`KC_RABK`/`KC_RIGHT_ANGLE_BRACKET` right angle bracket `>`
256 * `KC_COLN`/`KC_COLON` colon `:`
258 * `KC_QUES`/`KC_QUESTION` question mark `?`
259 * `KC_DQT`/`KC_DOUBLE_QUOTE`/`KC_DQUO` double quote `"`
263 * `LT(layer, kc)` turn on layer (0-15) when held, kc ([basic keycodes](basic_keycodes.md)) when tapped
264 * `TO(layer)` turn on layer when depressed
265 * `MO(layer)` momentarily turn on layer when depressed (requires `KC_TRNS` on destination layer)
266 * `DF(layer)` sets the base (default) layer
267 * `TG(layer)` toggle layer on/off
268 * `OSL(layer)` switch to layer for one keycode
269 * `TT(layer)` tap toggle? idk FIXME
273 * `UNICODE(n)`/`UC(n)` if `UNICODE_ENABLE`, this will send characters up to `0x7FFF`
274 * `X(n)` if `UNICODEMAP_ENABLE`, also sends unicode via a different method