aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/_summary.md31
-rw-r--r--docs/basic_keycodes.md6
-rw-r--r--docs/feature_audio.md118
-rw-r--r--docs/feature_backlight.md17
-rw-r--r--docs/feature_bluetooth.md13
-rw-r--r--docs/feature_bootmagic.md29
-rw-r--r--docs/feature_common_shortcuts.md4
-rw-r--r--docs/feature_rgblight.md18
-rw-r--r--docs/feature_thermal_printer.md10
-rw-r--r--docs/keycodes.md360
-rw-r--r--docs/keycodes_us_ansi_shifted.md31
-rw-r--r--docs/quantum_keycodes.md340
12 files changed, 616 insertions, 361 deletions
diff --git a/docs/_summary.md b/docs/_summary.md
index 4c4711064..071ce5631 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -13,27 +13,36 @@
13 13
14* [Features](features.md) 14* [Features](features.md)
15 * [Common Shortcuts](feature_common_shortcuts.md) 15 * [Common Shortcuts](feature_common_shortcuts.md)
16 * [Layer Switching](feature_common_shortcuts.md#switching-and-toggling-layers) 16 * [Backlight](feature_backlight.md)
17 * [Modifier Keys](feature_common_shortcuts.md#modifier-keys) 17 * [Bootmagic](feature_bootmagic.md)
18 * [Shifted Keycodes](feature_common_shortcuts.md#shifted-keycodes) 18 * [Dynamic Macros](dynamic_macros.md)
19 * [One Shot Keys](feature_common_shortcuts.md#one-shot-keys) 19 * [Key Lock](key_lock.md)
20 * [Mod Tap](feature_common_shortcuts.md#mod-tap)
21 * [Leader Key](leader_key.md) 20 * [Leader Key](leader_key.md)
22 * [Macros](macros.md) 21 * [Macros](macros.md)
23 * [Dynamic Macros](dynamic_macros.md) 22 * [Mouse keys](mouse_keys.md)
24 * [Space Cadet](space_cadet_shift.md) 23 * [Space Cadet](space_cadet_shift.md)
25 * [Tap Dance](tap_dance.md) 24 * [Tap Dance](tap_dance.md)
26 * [Mouse keys](mouse_keys.md) 25 * [Thermal Printer](feature_thermal_printer.md)
27 * [Unicode](unicode.md)
28 * [Stenography](stenography.md) 26 * [Stenography](stenography.md)
29 * [Key Lock](key_lock.md) 27 * [Unicode](unicode.md)
30 28
31* Reference 29* Reference
32 * [Glossary](glossary.md) 30 * [Glossary](glossary.md)
33 * [Keymap overview](keymap.md) 31 * [Keymap overview](keymap.md)
34 * [Keycodes](keycodes.md) 32 * [Keycodes](keycodes.md)
35 * [Basic Keycodes](basic_keycodes.md) 33 * [Basic](basic_keycodes.md)
36 * [Quantum Keycodes](quantum_keycodes.md) 34 * [Quantum](quantum_keycodes.md)
35 * [Backlight](feature_backlight.md#backlight-keycodes)
36 * [Bluetooth](feature_bluetooth.md#bluetooth-keycodes)
37 * [Bootmagic](feature_bootmagic.md#bootmagic-keycodes)
38 * [Layer Switching](feature_common_shortcuts.md#switching-and-toggling-layers)
39 * [Mod+Key](feature_common_shortcuts.md#modifier-keys)
40 * [Mod Tap](feature_common_shortcuts.md#mod-tap)
41 * [One Shot Keys](feature_common_shortcuts.md#one-shot-keys)
42 * [Shifted Keys](feature_common_shortcuts.md#shifted-keycodes)
43 * [RGB Light](feature_rgblight.md#rgblight-keycodes)
44 * [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes)
45 * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
37 * [The `config.h` File](config_options.md) 46 * [The `config.h` File](config_options.md)
38 * [Customizing Functionality](custom_quantum_functions.md) 47 * [Customizing Functionality](custom_quantum_functions.md)
39 * [Documentation Best Practices](documentation_best_practices.md) 48 * [Documentation Best Practices](documentation_best_practices.md)
diff --git a/docs/basic_keycodes.md b/docs/basic_keycodes.md
index 4f84647a2..b1f69ab16 100644
--- a/docs/basic_keycodes.md
+++ b/docs/basic_keycodes.md
@@ -1,5 +1,11 @@
1# Basic keycodes 1# Basic keycodes
2 2
3Basic keycodes are based on [HID Usage Keyboard/Keypad Page(0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with following exceptions:
4
5* `KC_NO` = 0 for no action
6* `KC_TRNS` = 1 for layer transparency
7* internal special keycodes in the `0xA5-DF` range (tmk heritage).
8
3## Letters and Numbers 9## Letters and Numbers
4 10
5|KC_1|KC_2|KC_3|KC_4|KC_5|KC_6|KC_7|KC_8| 11|KC_1|KC_2|KC_3|KC_4|KC_5|KC_6|KC_7|KC_8|
diff --git a/docs/feature_audio.md b/docs/feature_audio.md
new file mode 100644
index 000000000..6b476880d
--- /dev/null
+++ b/docs/feature_audio.md
@@ -0,0 +1,118 @@
1# Audio
2
3<!-- FIXME: this formatting needs work
4
5## Audio
6
7```c
8#ifdef AUDIO_ENABLE
9 AU_ON,
10 AU_OFF,
11 AU_TOG,
12
13 #ifdef FAUXCLICKY_ENABLE
14 FC_ON,
15 FC_OFF,
16 FC_TOG,
17 #endif
18
19 // Music mode on/off/toggle
20 MU_ON,
21 MU_OFF,
22 MU_TOG,
23
24 // Music voice iterate
25 MUV_IN,
26 MUV_DE,
27#endif
28```
29
30### Midi
31
32#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
33 MI_ON, // send midi notes when music mode is enabled
34 MI_OFF, // don't send midi notes when music mode is enabled
35#endif
36
37MIDI_TONE_MIN,
38MIDI_TONE_MAX
39
40MI_C = MIDI_TONE_MIN,
41MI_Cs,
42MI_Db = MI_Cs,
43MI_D,
44MI_Ds,
45MI_Eb = MI_Ds,
46MI_E,
47MI_F,
48MI_Fs,
49MI_Gb = MI_Fs,
50MI_G,
51MI_Gs,
52MI_Ab = MI_Gs,
53MI_A,
54MI_As,
55MI_Bb = MI_As,
56MI_B,
57
58MIDI_TONE_KEYCODE_OCTAVES > 1
59
60where x = 1-5:
61MI_C_x,
62MI_Cs_x,
63MI_Db_x = MI_Cs_x,
64MI_D_x,
65MI_Ds_x,
66MI_Eb_x = MI_Ds_x,
67MI_E_x,
68MI_F_x,
69MI_Fs_x,
70MI_Gb_x = MI_Fs_x,
71MI_G_x,
72MI_Gs_x,
73MI_Ab_x = MI_Gs_x,
74MI_A_x,
75MI_As_x,
76MI_Bb_x = MI_As_x,
77MI_B_x,
78
79MI_OCT_Nx 1-2
80MI_OCT_x 0-7
81MIDI_OCTAVE_MIN = MI_OCT_N2,
82MIDI_OCTAVE_MAX = MI_OCT_7,
83MI_OCTD, // octave down
84MI_OCTU, // octave up
85
86MI_TRNS_Nx 1-6
87MI_TRNS_x 0-6
88MIDI_TRANSPOSE_MIN = MI_TRNS_N6,
89MIDI_TRANSPOSE_MAX = MI_TRNS_6,
90MI_TRNSD, // transpose down
91MI_TRNSU, // transpose up
92
93MI_VEL_x 1-10
94MIDI_VELOCITY_MIN = MI_VEL_1,
95MIDI_VELOCITY_MAX = MI_VEL_9,
96MI_VELD, // velocity down
97MI_VELU, // velocity up
98
99MI_CHx 1-16
100MIDI_CHANNEL_MIN = MI_CH1
101MIDI_CHANNEL_MAX = MI_CH16,
102MI_CHD, // previous channel
103MI_CHU, // next channel
104
105MI_ALLOFF, // all notes off
106
107MI_SUS, // sustain
108MI_PORT, // portamento
109MI_SOST, // sostenuto
110MI_SOFT, // soft pedal
111MI_LEG, // legato
112
113MI_MOD, // modulation
114MI_MODSD, // decrease modulation speed
115MI_MODSU, // increase modulation speed
116#endif // MIDI_ADVANCED
117
118-->
diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md
new file mode 100644
index 000000000..c419b7ccc
--- /dev/null
+++ b/docs/feature_backlight.md
@@ -0,0 +1,17 @@
1# Backlighting
2
3<!-- FIXME: Describe how backlighting works in QMK -->
4
5## Backlight Keycodes
6
7These keycodes control the backlight. Most keyboards use this for single color in-switch lighting.
8
9|Name|Description|
10|----|-----------|
11|`BL_x`|Set a specific backlight level between 0-9|
12|`BL_ON`|An alias for `BL_9`|
13|`BL_OFF`|An alias for `BL_0`|
14|`BL_DEC`|Turn the backlight level down by 1|
15|`BL_INC`|Turn the backlight level up by 1|
16|`BL_TOGG`|Toggle the backlight on or off|
17|`BL_STEP`|Step through backlight levels, wrapping around to 0 when you reach the top.|
diff --git a/docs/feature_bluetooth.md b/docs/feature_bluetooth.md
new file mode 100644
index 000000000..d58627857
--- /dev/null
+++ b/docs/feature_bluetooth.md
@@ -0,0 +1,13 @@
1# Bluetooth
2
3<!-- FIXME: Document bluetooth support. -->
4
5## Bluetooth Keycodes
6
7This is used when multiple keyboard outputs can be selected. Currently this only allows for switching between USB and Bluetooth on keyboards that support both.
8
9|Name|Description|
10|----|-----------|
11|`OUT_AUTO`|auto mode|
12|`OUT_USB`|usb only|
13|`OUT_BT`|bluetooth|
diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md
new file mode 100644
index 000000000..3cf7d8d2a
--- /dev/null
+++ b/docs/feature_bootmagic.md
@@ -0,0 +1,29 @@
1# Bootmagic
2
3<!-- FIXME: Describe the bootmagic feature here. -->
4
5## Bootmagic Keycodes
6
7Shortcuts for bootmagic options. You can use these even when bootmagic is off.
8
9|Name|Description|
10|----|-----------|
11|`MAGIC_SWAP_CONTROL_CAPSLOCK`|Swap Capslock and Left Control|
12|`MAGIC_CAPSLOCK_TO_CONTROL`|Treat Capslock like a Control Key|
13|`MAGIC_SWAP_LALT_LGUI`|Swap the left Alt and GUI keys|
14|`MAGIC_SWAP_RALT_RGUI`|Swap the right Alt and GUI keys|
15|`MAGIC_NO_GUI`|Disable the GUI key|
16|`MAGIC_SWAP_GRAVE_ESC`|Swap the Grave and Esc key.|
17|`MAGIC_SWAP_BACKSLASH_BACKSPACE`|Swap backslack and backspace|
18|`MAGIC_HOST_NKRO`|Force NKRO on|
19|`MAGIC_SWAP_ALT_GUI`/`AG_SWAP`|Swap Alt and Gui on both sides|
20|`MAGIC_UNSWAP_CONTROL_CAPSLOCK`|Disable the Control/Capslock swap|
21|`MAGIC_UNCAPSLOCK_TO_CONTROL`|Disable treating Capslock like Control |
22|`MAGIC_UNSWAP_LALT_LGUI`|Disable Left Alt and GUI switching|
23|`MAGIC_UNSWAP_RALT_RGUI`|Disable Right Alt and GUI switching|
24|`MAGIC_UNNO_GUI`|Enable the GUI key |
25|`MAGIC_UNSWAP_GRAVE_ESC`|Disable the Grave/Esc swap |
26|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|Disable the backslash/backspace swap|
27|`MAGIC_UNHOST_NKRO`|Force NKRO off|
28|`MAGIC_UNSWAP_ALT_GUI`/`AG_NORM`|Disable the Alt/GUI switching|
29|`MAGIC_TOGGLE_NKRO`|Turn NKRO on or off|
diff --git a/docs/feature_common_shortcuts.md b/docs/feature_common_shortcuts.md
index 6a20ee64e..e91142026 100644
--- a/docs/feature_common_shortcuts.md
+++ b/docs/feature_common_shortcuts.md
@@ -25,7 +25,9 @@ These functions allow you to activate layers in various ways.
25* `TO(layer)` - Goes to a layer. This code is special, because it lets you go either up or down the stack -- just goes directly to the layer you want. So while other codes only let you go _up_ the stack (from layer 0 to layer 3, for example), `TO(2)` is going to get you to layer 2, no matter where you activate it from -- even if you're currently on layer 5. This gets activated on keydown (as soon as the key is pressed). 25* `TO(layer)` - Goes to a layer. This code is special, because it lets you go either up or down the stack -- just goes directly to the layer you want. So while other codes only let you go _up_ the stack (from layer 0 to layer 3, for example), `TO(2)` is going to get you to layer 2, no matter where you activate it from -- even if you're currently on layer 5. This gets activated on keydown (as soon as the key is pressed).
26* `TT(layer)` - Layer Tap-Toggle. If you hold the key down, the layer becomes active, and then deactivates when you let go. And if you tap it, the layer simply becomes active (toggles on). It needs 5 taps by default, but you can set it by defining `TAPPING_TOGGLE`, for example, `#define TAPPING_TOGGLE 2` for just two taps. 26* `TT(layer)` - Layer Tap-Toggle. If you hold the key down, the layer becomes active, and then deactivates when you let go. And if you tap it, the layer simply becomes active (toggles on). It needs 5 taps by default, but you can set it by defining `TAPPING_TOGGLE`, for example, `#define TAPPING_TOGGLE 2` for just two taps.
27 27
28Care must be taken when switching layers, it's possible to lock yourself in a layer with no way to deactivate that layer (without unplugging your keyboard.) We've created some guidelines to help users avoid the most common problems. 28## Working With Layers
29
30Care must be taken when switching layers, it's possible to lock yourself into a layer with no way to deactivate that layer (without unplugging your keyboard.) We've created some guidelines to help users avoid the most common problems.
29 31
30### Beginners 32### Beginners
31 33
diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md
new file mode 100644
index 000000000..8bbe06b97
--- /dev/null
+++ b/docs/feature_rgblight.md
@@ -0,0 +1,18 @@
1# RGB Lighting
2
3<!-- FIXME: Describe how to use RGB Lighting here. -->
4
5## RGB Lighting Keycodes
6
7This controls the RGB Lighting functionality. Most keyboards use WS2812 (and compatible) LEDs for underlight or case lighting.
8
9|Name|Description|
10|----|-----------|
11|`RGB_TOG`|toggle on/off|
12|`RGB_MOD`|cycle through modes|
13|`RGB_HUI`|hue increase|
14|`RGB_HUD`|hue decrease|
15|`RGB_SAI`|saturation increase|
16|`RGB_SAD`|saturation decrease|
17|`RGB_VAI`|value increase|
18|`RGB_VAD`|value decrease|
diff --git a/docs/feature_thermal_printer.md b/docs/feature_thermal_printer.md
new file mode 100644
index 000000000..0c5d15116
--- /dev/null
+++ b/docs/feature_thermal_printer.md
@@ -0,0 +1,10 @@
1# Thermal Printer
2
3<!-- FIXME: Describe thermal printers support here. -->
4
5## Thermal Printer Keycodes
6
7|Name|Description|
8|----|-----------|
9|`PRINT_ON`|Start printing everything the user types|
10|`PRINT_OFF`|Stop printing everything the user types|
diff --git a/docs/keycodes.md b/docs/keycodes.md
index 7c5cae8b3..b9e1f42f7 100644
--- a/docs/keycodes.md
+++ b/docs/keycodes.md
@@ -1,17 +1,351 @@
1# Overview 1# Overview
2 2
3When defining a [keymap](keymap.md) each key needs a valid key definition. 3When defining a [keymap](keymap.md) each key needs a valid key definition. This page documents the symbols that correspond to keycodes that are available to you in QMK. This is a reference only. Where possible keys link to the page documenting their functionality.
4 4
5This page documents the symbols that correspond to keycodes that are available to you in QMK. 5## Keycode Index
6 6
7## Basic keycodes (`0x00` - `0xFF`) 7|Long Name|Short Name|Description|
8 8|---------|----------|-----------|
9[Basic keycodes](basic_keycodes.md) in QMK are based on [HID Usage Keyboard/Keypad Page(0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with following exceptions: 9|`KC_1`||||
10 10|`KC_2`||||
11* `KC_NO` = 0 for no action 11|`KC_3`||||
12* `KC_TRNS` = 1 for layer transparency 12|`KC_4`||||
13* internal special keycodes in the `0xA5-DF` range (tmk heritage). 13|`KC_5`||||
14 14|`KC_6`||||
15## Quantum keycodes (`0x0100` - `0xFFFF`) 15|`KC_7`||||
16 16|`KC_8`||||
17[Quantum keycodes](quantum_keycodes.md) allow for easier customisation of your keymap than the basic ones provide, without having to define custom actions. 17|`KC_9`||||
18|`KC_0`||||
19|`KC_F1`||||
20|`KC_F2`||||
21|`KC_F3`||||
22|`KC_F4`||||
23|`KC_F5`||||
24|`KC_F6`||||
25|`KC_F7`||||
26|`KC_F8`||||
27|`KC_F9`||||
28|`KC_F10`||||
29|`KC_F11`||||
30|`KC_F12`||||
31|`KC_F13`||||
32|`KC_F14`||||
33|`KC_F15`||||
34|`KC_F16`||||
35|`KC_F17`||||
36|`KC_F18`||||
37|`KC_F19`||||
38|`KC_F20`||||
39|`KC_F21`||||
40|`KC_F22`||||
41|`KC_F23`||||
42|`KC_F24`||||
43|`KC_A`||||
44|`KC_B`||||
45|`KC_C`||||
46|`KC_D`||||
47|`KC_E`||||
48|`KC_F`||||
49|`KC_G`||||
50|`KC_H`||||
51|`KC_I`||||
52|`KC_J`||||
53|`KC_K`||||
54|`KC_L`||||
55|`KC_M`||||
56|`KC_N`||||
57|`KC_O`||||
58|`KC_P`||||
59|`KC_Q`||||
60|`KC_R`||||
61|`KC_S`||||
62|`KC_T`||||
63|`KC_U`||||
64|`KC_V`||||
65|`KC_W`||||
66|`KC_X`||||
67|`KC_Y`||||
68|`KC_Z`||||
69|Long Name|Short Name|Description|
70|---------|----------|-----------|
71|`KC_ENTER`|`KC_ENT`|`Return (ENTER)`|
72|`KC_ESCAPE`|`KC_ESC`|`ESCAPE`|
73|`KC_BSPACE`|`KC_BSPC`|`DELETE (Backspace)`|
74|`KC_TAB`||`Tab`|
75|`KC_SPACE`|`KC_SPC`|Spacebar|
76|`KC_MINUS`|`KC_MINS`|`-` and `_`|
77|`KC_EQUAL`|`KC_EQL`|`=` and `+`|
78|`KC_LBRACKET`|`KC_LBRC`|`[` and `{`|
79|`KC_RBRACKET`|`KC_RBRC`|`]` and `}`|
80|`KC_BSLASH`|`KC_BSLS`|`\` and <code>&#124;</code> |
81|`KC_NONUS_HASH`|`KC_NUHS`|Non-US `#` and `~`|
82|`KC_NONUS_BSLASH`|`KC_NUBS`|Non-US `\` and <code>&#124;</code> |
83|`KC_INT1`|`KC_RO`|JIS `\` and <code>&#124;</code> |
84|`KC_INT2`|`KC_KANA`|International216|
85|`KC_INT3`|`KC_JYEN`|Yen Symbol (`Â¥`)|
86|`KC_SCOLON`|`KC_SCLN`|`;` and `:`|
87|`KC_QUOTE`|`KC_QUOT`|`‘` and `“`|
88|`KC_GRAVE`|`KC_GRV`|Grave Accent and Tilde|
89|`KC_COMMA`|`KC_COMM`|`,` and `<`|
90|`KC_DOT`||`.` and `>`|
91|`KC_SLASH`|`KC_SLSH`|`/` and `?`|
92|`KC_CAPSLOCK`|`KC_CAPS`|Caps Lock|
93|Long Name|Short Name|Description|
94|---------|----------|-----------|
95|`KC_LCTRL`|`KC_LCTL`|LeftControl|
96|`KC_LSHIFT`|`KC_LSFT`|LeftShift|
97|`KC_LALT`||LeftAlt|
98|`KC_LGUI`||Left GUI(Windows/Apple/Meta key)|
99|`KC_RCTRL`|`KC_RCTL`|RightControl|
100|`KC_RSHIFT`|`KC_RSFT`|RightShift|
101|`KC_RALT`||RightAlt|
102|`KC_RGUI`||Right GUI(Windows/Apple/Meta key)|
103|`KC_LOCKING_CAPS`|`KC_LCAP`|Locking Caps Lock|
104|`KC_LOCKING_NUM`|`KC_LNUM`|Locking Num Lock|
105|`KC_LOCKING_SCROLL`|`KC_LSCR`|Locking Scroll Lock|
106|`KC_INT4`|`KC_HENK`|JIS Henken|
107|`KC_INT5`|`KC_MHEN`|JIS Muhenken|
108|Long Name|Short Name|Description|
109|---------|----------|-----------|
110|`KC_PSCREEN`|`KC_PSCR`|PrintScreen|
111|`KC_SCROLLLOCK`|`KC_SLCK`|Scroll Lock|
112|`KC_PAUSE`|`KC_PAUS`|Pause|
113|`KC_INSERT`|`KC_INS`|Insert|
114|`KC_HOME`||Home|
115|`KC_PGUP`||PageUp|
116|`KC_DELETE`|`KC_DEL`|Delete Forward|
117|`KC_END`||End|
118|`KC_PGDOWN`|`KC_PGDN`|PageDown|
119|`KC_RIGHT`|`KC_RGHT`|RightArrow|
120|`KC_LEFT`||LeftArrow|
121|`KC_DOWN`||DownArrow|
122|`KC_UP`||UpArrow|
123|`KC_APPLICATION`|`KC_APP`|Application|
124|`KC_POWER`||Power|
125|`KC_EXECUTE`||Execute|
126|`KC_HELP`||Help|
127|`KC_MENU`||Menu|
128|`KC_SELECT`||Select|
129|`KC_AGAIN`||Again|
130|`KC_UNDO`||Undo|
131|`KC_CUT`||Cut|
132|`KC_COPY`||Copy|
133|`KC_PASTE`||Paste|
134|`KC_FIND`||Find|
135|`KC_ALT_ERASE`||Alternate Erase|
136|`KC_SYSREQ`||SysReq/Attention|
137|`KC_CANCEL`||Cancel|
138|`KC_CLEAR`||Clear|
139|`KC_PRIOR`||Prior|
140|`KC_RETURN`||Return|
141|`KC_SEPARATOR`||Separator|
142|`KC_OUT`||Out|
143|`KC_OPER`||Oper|
144|`KC_CLEAR_AGAIN`||Clear/Again|
145|`KC_CRSEL`||CrSel/Props|
146|`KC_EXSEL`||ExSel|
147|`KC_SYSTEM_POWER`|`KC_PWR`|System Power Down|
148|`KC_SYSTEM_SLEEP`|`KC_SLEP`|System Sleep|
149|`KC_SYSTEM_WAKE`|`KC_WAKE`|System Wake|
150|`KC_MAIL`|`KC_MAIL`||
151|`KC_CALCULATOR`|`KC_CALC`||
152|`KC_MY_COMPUTER`|`KC_MYCM`||
153|`KC_WWW_SEARCH`|`KC_WSCH`||
154|`KC_WWW_HOME`|`KC_WHOM`||
155|`KC_WWW_BACK`|`KC_WBAK`||
156|`KC_WWW_FORWARD`|`KC_WFWD`||
157|`KC_WWW_STOP`|`KC_WSTP`||
158|`KC_WWW_REFRESH`|`KC_WREF`||
159|`KC_WWW_FAVORITES`|`KC_WFAV`||
160|Long Name|Short Name|Description|
161|---------|----------|-----------|
162|`KC_STOP`||Stop|
163|`KC__MUTE`||Mute|
164|`KC__VOLUP`||Volume Up|
165|`KC__VOLDOWN`||Volume Down|
166|`KC_AUDIO_MUTE`|`KC_MUTE`||
167|`KC_AUDIO_VOL_UP`|`KC_VOLU`||
168|`KC_AUDIO_VOL_DOWN`|`KC_VOLD`||
169|`KC_MEDIA_NEXT_TRACK`|`KC_MNXT`|Next Track (Windows)|
170|`KC_MEDIA_PREV_TRACK`|`KC_MPRV`|Previous Track (Windows)|
171|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS)|
172|`KC_MEDIA_REWIND`|`KC_MRWD`|Previous Track (macOS)|
173|`KC_MEDIA_STOP`|`KC_MSTP`||
174|`KC_MEDIA_PLAY_PAUSE`|`KC_MPLY`||
175|`KC_MEDIA_SELECT`|`KC_MSEL`||
176|Long Name|Short Name|Description|
177|---------|----------|-----------|
178|`KC_NUMLOCK`|`KC_NLCK`|Keypad Num Lock and Clear|
179|`KC_KP_SLASH`|`KC_PSLS`|Keypad /|
180|`KC_KP_ASTERISK`|`KC_PAST`|Keypad *|
181|`KC_KP_MINUS`|`KC_PMNS`|Keypad -|
182|`KC_KP_PLUS`|`KC_PPLS`|Keypad +|
183|`KC_KP_ENTER`|`KC_PENT`|Keypad ENTER`|
184|`KC_KP_1`|`KC_P1`|Keypad 1 and End|
185|`KC_KP_2`|`KC_P2`|Keypad 2 and Down Arrow|
186|`KC_KP_3`|`KC_P3`|Keypad 3 and PageDn|
187|`KC_KP_4`|`KC_P4`|Keypad 4 and Left Arrow|
188|`KC_KP_5`|`KC_P5`|Keypad 5|
189|`KC_KP_6`|`KC_P6`|Keypad 6 and Right Arrow|
190|`KC_KP_7`|`KC_P7`|Keypad 7 and Home|
191|`KC_KP_8`|`KC_P8`|Keypad 8 and Up Arrow|
192|`KC_KP_9`|`KC_P9`|Keypad 9 and PageUp|
193|`KC_KP_0`|`KC_P0`|Keypad 0 and Insert|
194|`KC_KP_DOT`|`KC_PDOT`|Keypad . and Delete|
195|`KC_KP_EQUAL`|`KC_PEQL`|Keypad =|
196|`KC_KP_COMMA`|`KC_PCMM`|Keypad Comma|
197|`KC_KP_EQUAL_AS400`||Keypad Equal Sign|
198|Long Name|Short Name|Description|
199|---------|----------|-----------|
200|`KC_NO`||Ignore this key. (NOOP) |
201|`KC_TRNS`||Make this key transparent to find the key on a lower layer.|
202|Long Name|Short Name|Description|
203|---------|----------|-----------|
204|[`KC_MS_UP`](mouse_keys.md)|`KC_MS_U`|Mouse Cursor Up|
205|[`KC_MS_DOWN`](mouse_keys.md)|`KC_MS_D`|Mouse Cursor Down|
206|[`KC_MS_LEFT`](mouse_keys.md)|`KC_MS_L`|Mouse Cursor Left|
207|[`KC_MS_RIGHT`](mouse_keys.md)|`KC_MS_R`|Mouse Cursor Right|
208|[`KC_MS_BTN1`](mouse_keys.md)|`KC_BTN1`|Mouse Button 1|
209|[`KC_MS_BTN2`](mouse_keys.md)|`KC_BTN2`|Mouse Button 2|
210|[`KC_MS_BTN3`](mouse_keys.md)|`KC_BTN3`|Mouse Button 3|
211|[`KC_MS_BTN4`](mouse_keys.md)|`KC_BTN4`|Mouse Button 4|
212|[`KC_MS_BTN5`](mouse_keys.md)|`KC_BTN5`|Mouse Button 5|
213|[`KC_MS_WH_UP`](mouse_keys.md)|`KC_WH_U`|Mouse Wheel Up|
214|[`KC_MS_WH_DOWN`](mouse_keys.md)|`KC_WH_D`|Mouse Wheel Down|
215|[`KC_MS_WH_LEFT`](mouse_keys.md)|`KC_WH_L`|Mouse Wheel Left|
216|[`KC_MS_WH_RIGHT`](mouse_keys.md)|`KC_WH_R`|Mouse Wheel Right|
217|[`KC_MS_ACCEL0`](mouse_keys.md)|`KC_ACL0`|Mouse Acceleration 0|
218|[`KC_MS_ACCEL1`](mouse_keys.md)|`KC_ACL1`|Mouse Acceleration 1|
219|[`KC_MS_ACCEL2`](mouse_keys.md)|`KC_ACL2`|Mouse Acceleration 2|
220|Long Name|Short Name|Description|
221|---------|----------|-----------|
222|[`RESET`](quantum_keycodes.md#qmk-keycodes)||Put the keyboard into DFU mode for flashing|
223|[`DEBUG`](quantum_keycodes.md#qmk-keycodes)||Toggles debug mode|
224|[`KC_GESC`](quantum_keycodes.md#qmk-keycodes)|`GRAVE_ESC`|Acts as escape when pressed normally but when pressed with Shift or GUI will send a `~`|
225|[`KC_LSPO`](quantum_keycodes.md#qmk-keycodes)||Left shift when held, open paranthesis when tapped|
226|[`KC_RSPC`](quantum_keycodes.md#qmk-keycodes)||Right shift when held, close paranthesis when tapped|
227|[`KC_LEAD`](quantum_keycodes.md#qmk-keycodes)||The [leader key](leader_key.md)|
228|[`FUNC(n)`](quantum_keycodes.md#qmk-keycodes)|`F(n)`|Call `fn_action(n)`|
229|[`M(n)`](quantum_keycodes.md#qmk-keycodes)||to call macro n|
230|[`MACROTAP(n)`](quantum_keycodes.md#qmk-keycodes)||to macro-tap n idk FIXME`|
231|Long Name|Short Name|Description|
232|---------|----------|-----------|
233|[`MAGIC_SWAP_CONTROL_CAPSLOCK`](feature_bootmagic.md)||Swap Capslock and Left Control|
234|[`MAGIC_CAPSLOCK_TO_CONTROL`](feature_bootmagic.md)||Treat Capslock like a Control Key|
235|[`MAGIC_SWAP_LALT_LGUI`](feature_bootmagic.md)||Swap the left Alt and GUI keys|
236|[`MAGIC_SWAP_RALT_RGUI`](feature_bootmagic.md)||Swap the right Alt and GUI keys|
237|[`MAGIC_NO_GUI`](feature_bootmagic.md)||Disable the GUI key|
238|[`MAGIC_SWAP_GRAVE_ESC`](feature_bootmagic.md)||Swap the Grave and Esc key.|
239|[`MAGIC_SWAP_BACKSLASH_BACKSPACE`](feature_bootmagic.md)||Swap backslack and backspace|
240|[`MAGIC_HOST_NKRO`](feature_bootmagic.md)||Force NKRO on|
241|[`MAGIC_SWAP_ALT_GUI`/`AG_SWAP`](feature_bootmagic.md)||Swap Alt and Gui on both sides|
242|[`MAGIC_UNSWAP_CONTROL_CAPSLOCK`](feature_bootmagic.md)||Disable the Control/Capslock swap|
243|[`MAGIC_UNCAPSLOCK_TO_CONTROL`](feature_bootmagic.md)||Disable treating Capslock like Control |
244|[`MAGIC_UNSWAP_LALT_LGUI`](feature_bootmagic.md)||Disable Left Alt and GUI switching|
245|[`MAGIC_UNSWAP_RALT_RGUI`](feature_bootmagic.md)||Disable Right Alt and GUI switching|
246|[`MAGIC_UNNO_GUI`](feature_bootmagic.md)||Enable the GUI key |
247|[`MAGIC_UNSWAP_GRAVE_ESC`](feature_bootmagic.md)||Disable the Grave/Esc swap |
248|[`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`](feature_bootmagic.md)||Disable the backslash/backspace swap|
249|[`MAGIC_UNHOST_NKRO`](feature_bootmagic.md)||Force NKRO off|
250|[`MAGIC_UNSWAP_ALT_GUI`/`AG_NORM`](feature_bootmagic.md)||Disable the Alt/GUI switching|
251|[`MAGIC_TOGGLE_NKRO`](feature_bootmagic.md)||Turn NKRO on or off|
252|Long Name|Short Name|Description|
253|---------|----------|-----------|
254|[`BL_x`](feature_backlight.md)||Set a specific backlight level between 0-9|
255|[`BL_ON`](feature_backlight.md)||An alias for `BL_9`|
256|[`BL_OFF`](feature_backlight.md)||An alias for `BL_0`|
257|[`BL_DEC`](feature_backlight.md)||Turn the backlight level down by 1|
258|[`BL_INC`](feature_backlight.md)||Turn the backlight level up by 1|
259|[`BL_TOGG`](feature_backlight.md)||Toggle the backlight on or off|
260|[`BL_STEP`](feature_backlight.md)||Step through backlight levels, wrapping around to 0 when you reach the top.|
261|Long Name|Short Name|Description|
262|---------|----------|-----------|
263|[`RGB_TOG`](feature_rgblight.md)||toggle on/off|
264|[`RGB_MOD`](feature_rgblight.md)||cycle through modes|
265|[`RGB_HUI`](feature_rgblight.md)||hue increase|
266|[`RGB_HUD`](feature_rgblight.md)||hue decrease|
267|[`RGB_SAI`](feature_rgblight.md)||saturation increase|
268|[`RGB_SAD`](feature_rgblight.md)||saturation decrease|
269|[`RGB_VAI`](feature_rgblight.md)||value increase|
270|[`RGB_VAD`](feature_rgblight.md)||value decrease|
271|Long Name|Short Name|Description|
272|---------|----------|-----------|
273|[`PRINT_ON`](feature_thermal_printer.md)||Start printing everything the user types|
274|[`PRINT_OFF`](feature_thermal_printer.md)||Stop printing everything the user types|
275|Long Name|Short Name|Description|
276|---------|----------|-----------|
277|[`OUT_AUTO`](feature_bluetooth.md)||auto mode|
278|[`OUT_USB`](feature_bluetooth.md)||usb only|
279|[`OUT_BT`](feature_bluetooth.md)||bluetooth (when `BLUETOOTH_ENABLE`)|
280|Long Name|Short Name|Description|
281|---------|----------|-----------|
282|[`KC_HYPR`](quantum_keycodes.md#modifiers)||Hold down LCTL + LSFT + LALT + LGUI`|
283|[`KC_MEH`](quantum_keycodes.md#modifiers)||Hold down LCTL + LSFT + LALT`|
284|[`LCTL(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `kc`|
285|[`LSFT(kc)`](quantum_keycodes.md#modifiers)|[`S(kc)`](quantum_keycodes.md#modifiers)|`LSFT` + `kc`|
286|[`LALT(kc)`](quantum_keycodes.md#modifiers)||`LALT` + `kc`|
287|[`LGUI(kc)`](quantum_keycodes.md#modifiers)||`LGUI` + `kc`|
288|[`RCTL(kc)`](quantum_keycodes.md#modifiers)||`RCTL` + `kc`|
289|[`RSFT(kc)`](quantum_keycodes.md#modifiers)||`RSFT` + `kc`|
290|[`RALT(kc)`](quantum_keycodes.md#modifiers)||`RALT` + `kc`|
291|[`RGUI(kc)`](quantum_keycodes.md#modifiers)||`RGUI` + `kc`|
292|[`HYPR(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `LSFT` + `LALT` + `LGUI` + `kc`|
293|[`MEH(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `LSFT` + `LALT` + `kc`|
294|[`LCAG(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `LALT` + `LGUI` + `kc`|
295|[`ALTG(kc)`](quantum_keycodes.md#modifiers)||`RCTL` + `RALT` + `kc`|
296|[`SCMD(kc)`](quantum_keycodes.md#modifiers)|[`SWIN(kc)`](quantum_keycodes.md#modifiers)|`LGUI` + `LSFT` + `kc`|
297|[`LCA(kc)`](quantum_keycodes.md#modifiers)||`LCTL` + `LALT` + `kc`|
298|Long Name|Short Name|Description|
299|---------|----------|-----------|
300|[`CTL_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`LCTL_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LCTL` when held, `kc` when tapped|
301|[`RCTL_T(kc)`](quantum_keycodes.md#mod-tap-keys)||[`RCTL` when held, `kc` when tapped|
302|[`SFT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`LSFT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LSFT` when held, `kc` when tapped|
303|[`RSFT_T(kc)`](quantum_keycodes.md#mod-tap-keys)||[`RSFT` when held, `kc` when tapped|
304|[`ALT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`LALT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LALT` when held, `kc` when tapped|
305|[`RALT_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`ALGR_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`RALT` when held, `kc` when tapped|
306|[`GUI_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`LGUI_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LGUI` when held, `kc` when tapped|
307|[`RGUI_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`RGUI` when held, `kc` when tapped|
308|[`C_S_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LSFT` when held, `kc` when tapped|
309|[`MEH_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LSFT` + `LALT` when held, `kc` when tapped|
310|[`LCAG_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LALT` + `LGUI` when held, `kc` when tapped|
311|[`RCAG_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`RCTL` + `RALT` + `RGUI` when held, `kc` when tapped|
312|[`ALL_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LSFT` + `LALT` + `LGUI` when held, `kc` when tapped [more info](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
313|[`SCMD_T(kc)`](quantum_keycodes.md#mod-tap-keys)|[`SWIN_T(kc)`](quantum_keycodes.md#mod-tap-keys)|`LGUI` + `LSFT` when held, `kc` when tapped|
314|[`LCA_T(kc)`](quantum_keycodes.md#mod-tap-keys)||`LCTL` + `LALT` when held, `kc` when tapped|
315|Short Name|Long Name|Description|
316|----------|---------|-----------|
317|[`KC_TILD`](keycodes_us_ansi_shifted.md)|`KC_TILDE`|tilde `~`|
318|[`KC_EXLM`](keycodes_us_ansi_shifted.md)|`KC_EXCLAIM`|exclamation mark `!`|
319|[`KC_AT`](keycodes_us_ansi_shifted.md)||at sign `@`|
320|[`KC_HASH`](keycodes_us_ansi_shifted.md)||hash sign `#`|
321|[`KC_DLR`](keycodes_us_ansi_shifted.md)|`KC_DOLLAR`|dollar sign `$`|
322|[`KC_PERC`](keycodes_us_ansi_shifted.md)|`KC_PERCENT`|percent sign `%`|
323|[`KC_CIRC`](keycodes_us_ansi_shifted.md)|`KC_CIRCUMFLEX`|circumflex `^`|
324|[`KC_AMPR`](keycodes_us_ansi_shifted.md)|`KC_AMPERSAND`|ampersand `&`|
325|[`KC_ASTR`](keycodes_us_ansi_shifted.md)|`KC_ASTERISK`|asterisk `*`|
326|[`KC_LPRN`](keycodes_us_ansi_shifted.md)|`KC_LEFT_PAREN`|left parenthesis `(`|
327|[`KC_RPRN`](keycodes_us_ansi_shifted.md)|`KC_RIGHT_PAREN`|right parenthesis `)`|
328|[`KC_UNDS`](keycodes_us_ansi_shifted.md)|`KC_UNDERSCORE`|underscore `_`|
329|[`KC_PLUS`](keycodes_us_ansi_shifted.md)||plus sign `+`|
330|[`KC_LCBR`](keycodes_us_ansi_shifted.md)|`KC_LEFT_CURLY_BRACE`|left curly brace `{`|
331|[`KC_RCBR`](keycodes_us_ansi_shifted.md)|`KC_RIGHT_CURLY_BRACE`|right curly brace `}`|
332|[`KC_LT`/`KC_LABK`](keycodes_us_ansi_shifted.md)|`KC_LEFT_ANGLE_BRACKET`|left angle bracket `<`|
333|[`KC_GT`/`KC_RABK`](keycodes_us_ansi_shifted.md)|`KC_RIGHT_ANGLE_BRACKET`|right angle bracket `>`|
334|[`KC_COLN`](keycodes_us_ansi_shifted.md)|`KC_COLON`|colon `:`|
335|[`KC_PIPE`](keycodes_us_ansi_shifted.md)||pipe `\|`|
336|[`KC_QUES`](keycodes_us_ansi_shifted.md)|`KC_QUESTION`|question mark `?`|
337|[`KC_DQT`/`KC_DQUO`](keycodes_us_ansi_shifted.md)|`KC_DOUBLE_QUOTE`|double quote `"`|
338|Long Name|Short Name|Description|
339|---------|----------|-----------|
340|[`LT(layer, kc)`](feature_common_shortcuts.md#switching-and-toggling-layers)||turn on layer (0-15) when held, kc ([basic keycodes](basic_keycodes.md)) when tapped|
341|[`TO(layer)`](feature_common_shortcuts.md#switching-and-toggling-layers)||turn on layer when depressed|
342|[`MO(layer)`](feature_common_shortcuts.md#switching-and-toggling-layers)||momentarily turn on layer when depressed (requires `KC_TRNS` on destination layer)|
343|[`DF(layer)`](feature_common_shortcuts.md#switching-and-toggling-layers)||sets the base (default) layer|
344|[`TG(layer)`](feature_common_shortcuts.md#switching-and-toggling-layers)||toggle layer on/off|
345|[`TT(layer)](feature_common_shortcuts.md#switching-and-toggling-layers)`||tap toggle? idk FIXME`|
346|[`OSM(mod)`](quantum_keycodes.md#one-shot-keys)||hold mod for one keypress|
347|[`OSL(layer)`](quantum_keycodes.md#one-shot-keys)||switch to layer for one keypress|
348|Long Name|Short Name|Description|
349|---------|----------|-----------|
350|[`UNICODE(n)`](unicode.md)|[`UC(n)`](unicode.md)|if `UNICODE_ENABLE`, this will send characters up to `0x7FFF`|
351|[`X(n)`](unicode.md)||if `UNICODEMAP_ENABLE`, also sends unicode via a different method|
diff --git a/docs/keycodes_us_ansi_shifted.md b/docs/keycodes_us_ansi_shifted.md
new file mode 100644
index 000000000..6c7ef4caa
--- /dev/null
+++ b/docs/keycodes_us_ansi_shifted.md
@@ -0,0 +1,31 @@
1# US ANSI Shifted symbols
2
3These keycodes correspond to characters that are "shifted" on a standard US ANSI keyboards. They do not have dedicated keycodes but are instead typed by holding down shift and then sending a keycode.
4
5It's important to remember that all of these keycodes send a left shift - this may cause unintended actions if unaccounted for. The short code is preferred in most situations.
6
7## US ANSI Shifted Keycodes
8
9|Short Name|Long Name|Description|
10|----------|---------|-----------|
11|`KC_TILD`|`KC_TILDE`|tilde `~`|
12|`KC_EXLM`|`KC_EXCLAIM`|exclamation mark `!`|
13|`KC_AT`||at sign `@`|
14|`KC_HASH`||hash sign `#`|
15|`KC_DLR`|`KC_DOLLAR`|dollar sign `$`|
16|`KC_PERC`|`KC_PERCENT`|percent sign `%`|
17|`KC_CIRC`|`KC_CIRCUMFLEX`|circumflex `^`|
18|`KC_AMPR`|`KC_AMPERSAND`|ampersand `&`|
19|`KC_ASTR`|`KC_ASTERISK`|asterisk `*`|
20|`KC_LPRN`|`KC_LEFT_PAREN`|left parenthesis `(`|
21|`KC_RPRN`|`KC_RIGHT_PAREN`|right parenthesis `)`|
22|`KC_UNDS`|`KC_UNDERSCORE`|underscore `_`|
23|`KC_PLUS`||plus sign `+`|
24|`KC_LCBR`|`KC_LEFT_CURLY_BRACE`|left curly brace `{`|
25|`KC_RCBR`|`KC_RIGHT_CURLY_BRACE`|right curly brace `}`|
26|`KC_LT`/`KC_LABK`|`KC_LEFT_ANGLE_BRACKET`|left angle bracket `<`|
27|`KC_GT`/`KC_RABK`|`KC_RIGHT_ANGLE_BRACKET`|right angle bracket `>`|
28|`KC_COLN`|`KC_COLON`|colon `:`|
29|`KC_PIPE`||pipe `\|`|
30|`KC_QUES`|`KC_QUESTION`|question mark `?`|
31|`KC_DQT`/`KC_DQUO`|`KC_DOUBLE_QUOTE`|double quote `"`|
diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md
index 0f2b8e72f..2e17ae4b7 100644
--- a/docs/quantum_keycodes.md
+++ b/docs/quantum_keycodes.md
@@ -1,8 +1,10 @@
1# Quantum Keycodes 1# Quantum Keycodes
2 2
3Quantum keycodes allow for easier customisation of your keymap than the basic ones provide, without having to define custom actions.
4
3All keycodes within quantum are numbers between `0x0000` and `0xFFFF`. Within your `keymap.c` it may look like you have functions and other special cases, but ultimately the C preprocessor will translate those into a single 4 byte integer. QMK has reserved `0x0000` through `0x00FF` for standard keycodes. These are keycodes such as `KC_A`, `KC_1`, and `KC_LCTL`, which are basic keys defined in the USB HID specification. 5All keycodes within quantum are numbers between `0x0000` and `0xFFFF`. Within your `keymap.c` it may look like you have functions and other special cases, but ultimately the C preprocessor will translate those into a single 4 byte integer. QMK has reserved `0x0000` through `0x00FF` for standard keycodes. These are keycodes such as `KC_A`, `KC_1`, and `KC_LCTL`, which are basic keys defined in the USB HID specification.
4 6
5On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are used to implement advanced quantum features. If you define your own custom keycodes they will be put into this range as well. Keycodes above `0x00FF` may not be used with any of the mod/layer-tap keys listed 7On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are used to implement advanced quantum features. If you define your own custom keycodes they will be put into this range as well.
6 8
7## QMK keycodes 9## QMK keycodes
8 10
@@ -14,341 +16,7 @@ On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are
14|`KC_LSPO`|Left shift when held, open paranthesis when tapped| 16|`KC_LSPO`|Left shift when held, open paranthesis when tapped|
15|`KC_RSPC`|Right shift when held, close paranthesis when tapped| 17|`KC_RSPC`|Right shift when held, close paranthesis when tapped|
16|`KC_LEAD`|The [leader key](leader_key.md)| 18|`KC_LEAD`|The [leader key](leader_key.md)|
19|`KC_LOCK`|The [lock key](key_lock.md)|
17|`FUNC(n)`/`F(n)`|Call `fn_action(n)`| 20|`FUNC(n)`/`F(n)`|Call `fn_action(n)`|
18|`M(n)`|to call macro n| 21|`M(n)`|to call macro n|
19|`MACROTAP(n)`|to macro-tap n idk FIXME| 22|`MACROTAP(n)`|to macro-tap n idk FIXME|
20|`KC_LOCK`|The [lock key](key_lock.md)|
21
22## Bootmagic Keycodes
23
24Shortcuts for bootmagic options (these work even when bootmagic is off.)
25
26|Name|Description|
27|----|-----------|
28|`MAGIC_SWAP_CONTROL_CAPSLOCK`|Swap Capslock and Left Control|
29|`MAGIC_CAPSLOCK_TO_CONTROL`|Treat Capslock like a Control Key|
30|`MAGIC_SWAP_LALT_LGUI`|Swap the left Alt and GUI keys|
31|`MAGIC_SWAP_RALT_RGUI`|Swap the right Alt and GUI keys|
32|`MAGIC_NO_GUI`|Disable the GUI key|
33|`MAGIC_SWAP_GRAVE_ESC`|Swap the Grave and Esc key.|
34|`MAGIC_SWAP_BACKSLASH_BACKSPACE`|Swap backslack and backspace|
35|`MAGIC_HOST_NKRO`|Force NKRO on|
36|`MAGIC_SWAP_ALT_GUI`/`AG_SWAP`|Swap Alt and Gui on both sides|
37|`MAGIC_UNSWAP_CONTROL_CAPSLOCK`|Disable the Control/Capslock swap|
38|`MAGIC_UNCAPSLOCK_TO_CONTROL`|Disable treating Capslock like Control |
39|`MAGIC_UNSWAP_LALT_LGUI`|Disable Left Alt and GUI switching|
40|`MAGIC_UNSWAP_RALT_RGUI`|Disable Right Alt and GUI switching|
41|`MAGIC_UNNO_GUI`|Enable the GUI key |
42|`MAGIC_UNSWAP_GRAVE_ESC`|Disable the Grave/Esc swap |
43|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|Disable the backslash/backspace swap|
44|`MAGIC_UNHOST_NKRO`|Force NKRO off|
45|`MAGIC_UNSWAP_ALT_GUI`/`AG_NORM`|Disable the Alt/GUI switching|
46|`MAGIC_TOGGLE_NKRO`|Turn NKRO on or off|
47
48<!-- FIXME: this formatting needs work
49
50## Audio
51
52```c
53#ifdef AUDIO_ENABLE
54 AU_ON,
55 AU_OFF,
56 AU_TOG,
57
58 #ifdef FAUXCLICKY_ENABLE
59 FC_ON,
60 FC_OFF,
61 FC_TOG,
62 #endif
63
64 // Music mode on/off/toggle
65 MU_ON,
66 MU_OFF,
67 MU_TOG,
68
69 // Music voice iterate
70 MUV_IN,
71 MUV_DE,
72#endif
73```
74
75### Midi
76
77#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
78 MI_ON, // send midi notes when music mode is enabled
79 MI_OFF, // don't send midi notes when music mode is enabled
80#endif
81
82MIDI_TONE_MIN,
83MIDI_TONE_MAX
84
85MI_C = MIDI_TONE_MIN,
86MI_Cs,
87MI_Db = MI_Cs,
88MI_D,
89MI_Ds,
90MI_Eb = MI_Ds,
91MI_E,
92MI_F,
93MI_Fs,
94MI_Gb = MI_Fs,
95MI_G,
96MI_Gs,
97MI_Ab = MI_Gs,
98MI_A,
99MI_As,
100MI_Bb = MI_As,
101MI_B,
102
103MIDI_TONE_KEYCODE_OCTAVES > 1
104
105where x = 1-5:
106MI_C_x,
107MI_Cs_x,
108MI_Db_x = MI_Cs_x,
109MI_D_x,
110MI_Ds_x,
111MI_Eb_x = MI_Ds_x,
112MI_E_x,
113MI_F_x,
114MI_Fs_x,
115MI_Gb_x = MI_Fs_x,
116MI_G_x,
117MI_Gs_x,
118MI_Ab_x = MI_Gs_x,
119MI_A_x,
120MI_As_x,
121MI_Bb_x = MI_As_x,
122MI_B_x,
123
124MI_OCT_Nx 1-2
125MI_OCT_x 0-7
126MIDI_OCTAVE_MIN = MI_OCT_N2,
127MIDI_OCTAVE_MAX = MI_OCT_7,
128MI_OCTD, // octave down
129MI_OCTU, // octave up
130
131MI_TRNS_Nx 1-6
132MI_TRNS_x 0-6
133MIDI_TRANSPOSE_MIN = MI_TRNS_N6,
134MIDI_TRANSPOSE_MAX = MI_TRNS_6,
135MI_TRNSD, // transpose down
136MI_TRNSU, // transpose up
137
138MI_VEL_x 1-10
139MIDI_VELOCITY_MIN = MI_VEL_1,
140MIDI_VELOCITY_MAX = MI_VEL_9,
141MI_VELD, // velocity down
142MI_VELU, // velocity up
143
144MI_CHx 1-16
145MIDI_CHANNEL_MIN = MI_CH1
146MIDI_CHANNEL_MAX = MI_CH16,
147MI_CHD, // previous channel
148MI_CHU, // next channel
149
150MI_ALLOFF, // all notes off
151
152MI_SUS, // sustain
153MI_PORT, // portamento
154MI_SOST, // sostenuto
155MI_SOFT, // soft pedal
156MI_LEG, // legato
157
158MI_MOD, // modulation
159MI_MODSD, // decrease modulation speed
160MI_MODSU, // increase modulation speed
161#endif // MIDI_ADVANCED
162
163-->
164
165## Backlight
166
167These keycodes control the backlight. Most keyboards use this for single color in-switch lighting.
168
169|Name|Description|
170|----|-----------|
171|`BL_x`|Set a specific backlight level between 0-9|
172|`BL_ON`|An alias for `BL_9`|
173|`BL_OFF`|An alias for `BL_0`|
174|`BL_DEC`|Turn the backlight level down by 1|
175|`BL_INC`|Turn the backlight level up by 1|
176|`BL_TOGG`|Toggle the backlight on or off|
177|`BL_STEP`|Step through backlight levels, wrapping around to 0 when you reach the top.|
178
179## RGBLIGHT WS2818 LEDs
180
181This controls the `RGBLIGHT` functionality. Most keyboards use WS2812 (and compatible) LEDs for underlight or case lighting.
182
183|Name|Description|
184|----|-----------|
185|`RGB_TOG`|toggle on/off|
186|`RGB_MOD`|cycle through modes|
187|`RGB_HUI`|hue increase|
188|`RGB_HUD`|hue decrease|
189|`RGB_SAI`|saturation increase|
190|`RGB_SAD`|saturation decrease|
191|`RGB_VAI`|value increase|
192|`RGB_VAD`|value decrease|
193
194## Thermal Printer (experimental)
195
196|Name|Description|
197|----|-----------|
198|`PRINT_ON`|Start printing everything the user types|
199|`PRINT_OFF`|Stop printing everything the user types|
200
201## Keyboard output selection
202
203This is used when multiple keyboard outputs can be selected. Currently this only allows for switching between USB and Bluetooth on keyboards that support both.
204
205|Name|Description|
206|----|-----------|
207|`OUT_AUTO`|auto mode|
208|`OUT_USB`|usb only|
209|`OUT_BT`|bluetooth (when `BLUETOOTH_ENABLE`)|
210
211## Modifiers
212
213These are special keycodes that simulate pressing several modifiers at once.
214
215|Name|Description|
216|----|-----------|
217|`KC_HYPR`|Hold down LCTL + LSFT + LALT + LGUI|
218|`KC_MEH`|Hold down LCTL + LSFT + LALT|
219
220/* FIXME: Should we have these in QMK too?
221 * |`KC_LCAG`|`LCTL` + `LALT` + `LGUI`|
222 * |`KC_ALTG`|`RCTL` + `RALT`|
223 * |`KC_SCMD`/`KC_SWIN`|`LGUI` + `LSFT`|
224 * |`KC_LCA`|`LCTL` + `LALT`|
225 */
226
227### Modifiers with keys
228
229|Name|Description|
230|----|-----------|
231|`LCTL(kc)`|`LCTL` + `kc`|
232|`LSFT(kc)`/`S(kc)`|`LSFT` + `kc`|
233|`LALT(kc)`|`LALT` + `kc`|
234|`LGUI(kc)`|`LGUI` + `kc`|
235|`RCTL(kc)`|`RCTL` + `kc`|
236|`RSFT(kc)`|`RSFT` + `kc`|
237|`RALT(kc)`|`RALT` + `kc`|
238|`RGUI(kc)`|`RGUI` + `kc`|
239|`HYPR(kc)`|`LCTL` + `LSFT` + `LALT` + `LGUI` + `kc`|
240|`MEH(kc)`|`LCTL` + `LSFT` + `LALT` + `kc`|
241|`LCAG(kc)`|`LCTL` + `LALT` + `LGUI` + `kc`|
242|`ALTG(kc)`|`RCTL` + `RALT` + `kc`|
243|`SCMD(kc)`/`SWIN(kc)`|`LGUI` + `LSFT` + `kc`|
244|`LCA(kc)`|`LCTL` + `LALT` + `kc`|
245
246### One Shot Keys
247
248Most modifiers work by being held down while you push another key. You can use `OSM()` to setup a "One Shot" modifier. When you tap a one shot mod it will remain is a pressed state until you press another key.
249
250To specify a your modifier you need to pass the `MOD` form of the key. For example, if you want to setup a One Shot Control you would use `OSM(MOD_LCTL)`.
251
252|Name|Description|
253|----|-----------|
254|`OSM(mod)`|use mod for one keypress|
255|`OSL(layer)`|switch to layer for one keypress|
256
257### Mod-tap keys
258
259These keycodes will press the mod(s) when held, and the key when tapped. They only work with [basic keycodes](basic_keycodes.md).
260
261|Name|Description|
262|----|-----------|
263|`CTL_T(kc)`/`LCTL_T(kc)`|`LCTL` when held, `kc` when tapped|
264|`RCTL_T(kc)`|`RCTL` when held, `kc` when tapped|
265|`SFT_T(kc)`/`LSFT_T(kc)`|`LSFT` when held, `kc` when tapped|
266|`RSFT_T(kc)`|`RSFT` when held, `kc` when tapped|
267|`ALT_T(kc)`/`LALT_T(kc)`|`LALT` when held, `kc` when tapped|
268|`RALT_T(kc)`/`ALGR_T(kc)`|`RALT` when held, `kc` when tapped|
269|`GUI_T(kc)`/`LGUI_T(kc)`|`LGUI` when held, `kc` when tapped|
270|`RGUI_T(kc)`|`RGUI` when held, `kc` when tapped|
271|`C_S_T(kc)`|`LCTL` + `LSFT` when held, `kc` when tapped|
272|`MEH_T(kc)`|`LCTL` + `LSFT` + `LALT` when held, `kc` when tapped|
273|`LCAG_T(kc)`|`LCTL` + `LALT` + `LGUI` when held, `kc` when tapped|
274|`RCAG_T(kc)`|`RCTL` + `RALT` + `RGUI` when held, `kc` when tapped|
275|`ALL_T(kc)`|`LCTL` + `LSFT` + `LALT` + `LGUI` when held, `kc` when tapped [more info](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
276|`SCMD_T(kc)`/`SWIN_T(kc)`|`LGUI` + `LSFT` when held, `kc` when tapped|
277|`LCA_T(kc)`|`LCTL` + `LALT` when held, `kc` when tapped|
278
279## US ANSI Shifted symbols
280
281These keycodes correspond to characters that are "shifted" on a standard US ANSI keyboards. They do not have dedicated keycodes but are instead typed by holding down shift and then sending a keycode.
282
283It's important to remember that all of these keycodes send a left shift - this may cause unintended actions if unaccounted for. The short code is preferred in most situations.
284
285|Short Name|Long Name|Description|
286|----------|---------|-----------|
287|`KC_TILD`|`KC_TILDE`|tilde `~`|
288|`KC_EXLM`|`KC_EXCLAIM`|exclamation mark `!`|
289|`KC_AT`||at sign `@`|
290|`KC_HASH`||hash sign `#`|
291|`KC_DLR`|`KC_DOLLAR`|dollar sign `$`|
292|`KC_PERC`|`KC_PERCENT`|percent sign `%`|
293|`KC_CIRC`|`KC_CIRCUMFLEX`|circumflex `^`|
294|`KC_AMPR`|`KC_AMPERSAND`|ampersand `&`|
295|`KC_ASTR`|`KC_ASTERISK`|asterisk `*`|
296|`KC_LPRN`|`KC_LEFT_PAREN`|left parenthesis `(`|
297|`KC_RPRN`|`KC_RIGHT_PAREN`|right parenthesis `)`|
298|`KC_UNDS`|`KC_UNDERSCORE`|underscore `_`|
299|`KC_PLUS`||plus sign `+`|
300|`KC_LCBR`|`KC_LEFT_CURLY_BRACE`|left curly brace `{`|
301|`KC_RCBR`|`KC_RIGHT_CURLY_BRACE`|right curly brace `}`|
302|`KC_LT`/`KC_LABK`|`KC_LEFT_ANGLE_BRACKET`|left angle bracket `<`|
303|`KC_GT`/`KC_RABK`|`KC_RIGHT_ANGLE_BRACKET`|right angle bracket `>`|
304|`KC_COLN`|`KC_COLON`|colon `:`|
305|`KC_PIPE`||pipe `\|`|
306|`KC_QUES`|`KC_QUESTION`|question mark `?`|
307|`KC_DQT`/`KC_DQUO`|`KC_DOUBLE_QUOTE`|double quote `"`|
308
309## Layer Changes
310
311These are keycodes that can be used to change the current layer.
312
313|Name|Description|
314|----|-----------|
315|`LT(layer, kc)`|turn on layer (0-15) when held, kc ([basic keycodes](basic_keycodes.md)) when tapped|
316|`TO(layer)`|turn on layer when depressed|
317|`MO(layer)`|momentarily turn on layer when depressed (requires `KC_TRNS` on destination layer)|
318|`DF(layer)`|sets the base (default) layer|
319|`TG(layer)`|toggle layer on/off|
320|`TT(layer)`|tap toggle? idk FIXME|
321|`OSL(layer)`|switch to layer for one keycode|
322
323## Unicode
324
325These keycodes can be used in conjuction with the [Unicode](unicode_and_additional_language_support.md) support.
326
327|`UNICODE(n)`/`UC(n)`|if `UNICODE_ENABLE`, this will send characters up to `0x7FFF`|
328|`X(n)`|if `UNICODEMAP_ENABLE`, also sends unicode via a different method|
329
330# `SAFE_RANGE`, or safely defining custom keycodes
331
332Sometimes you want to define your own custom keycodes to make your keymap easier to read. QMK provides `SAFE_RANGE` to help you do that. `SAFE_RANGE` is the first available keycode in the `0x0000`-`0xFFFF` range and you can use it when creating your own custom keycode enum:
333
334```
335enum my_keycodes {
336 FOO = SAFE_RANGE,
337 BAR
338};
339```
340
341You can then use `process_record_user()` to do something with your keycode:
342
343```
344bool process_record_user(uint16_t keycode, keyrecord_t *record) {
345 switch (keycode) {
346 case FOO:
347 // Do something here
348 break;
349 case BAR:
350 // Do something here
351 break;
352 }
353}
354```