<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> COMBO</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(test_combo2, </span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">LCTL</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(KC_Z)),</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // keycodes with modifiers are possible too!</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><p>This will send "Escape" if you hit the A and B keys, and Ctrl+Z when you hit the C and D keys.</p><h2id="advanced-keycodes-support"tabindex="-1">Advanced Keycodes Support <aclass="header-anchor"href="#advanced-keycodes-support"aria-label="Permalink to "Advanced Keycodes Support""></a></h2><p>Advanced keycodes, such as <ahref="./../mod_tap">Mod-Tap</a> and <ahref="./tap_dance">Tap Dance</a> are also supported together with combos. If you use these advanced keycodes in your keymap, you will need to place the full keycode in the combo definition, e.g.:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> uint16_t</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> PROGMEM test_combo1</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">[]</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">LSFT_T</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(KC_A), </span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">LT</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, KC_B), COMBO_END};</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> uint16_t</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> PROGMEM test_combo2</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">[]</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">TD</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(TD_ESC_CAPS), KC_F1, COMBO_END};</span></span></code></pre></div><h2id="overlapping-combos"tabindex="-1">Overlapping Combos <aclass="header-anchor"href="#overlapping-combos"aria-label="Permalink to "Overlapping Combos""></a></h2><p>It is possible to overlap combos. Before, with the example below both combos would activate when all three keys were pressed. Now only the three key combo will activate.</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> uint16_t</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> PROGMEM test_combo1</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">[]</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">LSFT_T</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(KC_A), </span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">LT</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, KC_B), COMBO_END};</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><h2id="examples"tabindex="-1">Examples <aclass="header-anchor"href="#examples"aria-label="Permalink to "Examples""></a></h2><p>A long list of combos can be defined in an <code>enum</code> list:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">enum</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> combos {</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><p>For a more complicated implementation, you can use the <code>process_combo_event</code> function to add custom handling.</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">enum</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> combo_events {</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>This will send "<ahref="mailto:john.doe@example.com"target="_blank"rel="noreferrer">john.doe@example.com</a>" if you chord E and M together, and clear the current line with Backspace and Left-Shift. You could change this to do stuff like play sounds or change settings.</p><p>It is worth noting that <code>COMBO_ACTION</code>s are not needed anymore. As of <ahref="https://github.com/qmk/qmk_firmware/pull/8591/"target="_blank"rel="noreferrer">PR#8591</a>, it is possible to run your own custom keycodes from combos. Just define the custom keycode, program its functionality in <code>process_record_user</code>, and define a combo with <code>COMBO(<key_array>, <your_custom_keycode>)</code>. See the first example in <ahref="./../feature_macros">Macros</a>.</p><h2id="keycodes"tabindex="-1">Keycodes <aclass="header-anchor"href="#keycodes"aria-label="Permalink to "Keycodes""></a></h2><p>You can enable, disable and toggle the Combo feature on the fly. This is useful if you need to disable them temporarily, such as for a game. The following keycodes are available for use in your <code>keymap.c</code></p><table><thead><tr><th>Keycode</th><th>Aliases</th><th>Description</th></tr></thead><tbody><tr><td><code>QK_COMBO_ON</code></td><td><code>CM_ON</code></td><td>Turns on Combo feature</td></tr><tr><td><code>QK_COMBO_OFF</code></td><td><code>CM_OFF</code></td><td>Turns off Combo feature</td></tr><tr><td><code>QK_COMBO_TOGGLE</code></td><td><code>CM_TOGG</code></td><td>Toggles Combo feature on and off</td></tr></tbody></table><h2id="advanced-configuration"tabindex="-1">Advanced Configuration <aclass="header-anchor"href="#advanced-configuration"aria-label="Permalink to "Advanced Configuration""></a></h2><p>These configuration settings can be set in your <code>config.h</code> file.</p><h3id="combo-term"tabindex="-1">Combo Term <aclass="header-anchor"href="#combo-term"aria-label="Permalink to "Combo Term""></a></h3><p>By default, the timeout for the Combos to be recognized is set to 50ms. This can be changed if accidental combo misfires are happening or if you're having difficulties pressing keys at the same time. For instance, <code>#define COMBO_TERM 40</code> would set the timeout period for combos to 40ms.</p><h3id="buffer-and-state-sizes"tabindex="-1">Buffer and state sizes <aclass="header-anchor"href="#buffer-and-state-sizes"aria-label="Permalink to "Buffer and state sizes""></a></h3><p>If you're using long combos, or you have a lot of overlapping combos, you may run into issues with this, as the buffers may not be large enough to accommodate what you're doing. In this case, you can configure the sizes of the buffers used. Be aware, larger combo sizes and larger buffers will increase memory usage!</p><p>To configure the amount of keys a combo can be composed of, change the following:</p><table><thead><tr><th>Keys</th><th>Define to be set</th></tr></thead><tbody><tr><td>6</td><td><code>#define EXTRA_SHORT_COMBOS</code></td></tr><tr><td>8</td><td>QMK Default</td></tr><tr><td>16</td><td><code>#define EXTRA_LONG_COMBOS</code></td></tr><tr><td>32</td><td><code>#define EXTRA_EXTRA_LONG_COMBOS</code></td></tr></tbody></table><p>Defining <code>EXTRA_SHORT_COMBOS</code> combines a combo's internal state into just one byte. This can, in some cases, save some memory. If it doesn't, no point using it. If you do, you also have to make sure you don't define combos with more than 6 keys.</p><p>Processing combos has two buffers, one for the key presses, another for the combos being activated. Use the following options to configure the sizes of these buffers:</p><table><thead><tr><th>Define</th><th>Default</th></tr></thead><tbody><tr><td><code>#define COMBO_KEY_BUFFER_LENGTH 8</code></td><td>8 (the key amount <code>(EXTRA_)EXTRA_LONG_COMBOS</code> gives)</td></tr><tr><td><code>#define COMBO_BUFFER_LENGTH 4</code></td><
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // And if you're feeling adventurous, you can even decide by the keys in the chord,</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // i.e. the exact array of keys you defined for the combo.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // This can be useful if your combos have a common key and you want to apply the</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // same combo term for all of them.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (combo->keys[</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">==</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KC_ENT) {</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // if first key in the array is Enter</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Same as above, decide by keycode, the combo index, or by the keys in the chord.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // If you want all combos to be tap-only, just uncomment the next line</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // If you want *all* combos, that have Mod-Tap/Layer-Tap/Momentary keys in its chord, to be tap-only, this is for you:</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /* List combos here that you want to only activate if their keys</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * are pressed in the same order as they are defined in the combo's key</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3id="generic-hook-to-dis-allow-a-combo-activation"tabindex="-1">Generic hook to (dis)allow a combo activation <aclass="header-anchor"href="#generic-hook-to-dis-allow-a-combo-activation"aria-label="Permalink to "Generic hook to (dis)allow a combo activation""></a></h3><p>By defining <code>COMBO_SHOULD_TRIGGER</code> and its companying function <code>bool combo_should_trigger(uint16_t combo_index, combo_t *combo, uint16_t keycode, keyrecord_t *record)</code> you can block or allow combos to activate on the conditions of your choice. For example, you could disallow some combos on the base layer and allow them on another. Or disable combos on the home row when a timer is running.</p><p>Examples:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">bool</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> combo_should_trigger</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">uint16_t</span><spanstyle="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> combo_index</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">combo_t</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><spanstyle="--shiki-light:#E36209;--shiki-dark:#FFAB70;">combo</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">uint16_t</span><spanstyle="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> keycode</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">keyrecord_t</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><spanstyle="--shiki-light:#E36209;--shiki-dark:#FFAB70;">record</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /* Disable combo `SOME_COMBO` on layer `_LAYER_A` */</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3id="combo-timer"tabindex="-1">Combo timer <aclass="header-anchor"href="#combo-timer"aria-label="Permalink to "Combo timer""></a></h3><p>Normally, the timer is started on the first key press and then reset on every subsequent key press within the <code>COMBO_TERM</code>. Inputting combos is relaxed like this, but also slightly more prone to accidental misfires.</p><p>The next two options alter the behaviour of the timer.</p><h4id="define-combo-strict-timer"tabindex="-1"><code>#define COMBO_STRICT_TIMER</code><aclass="header-anchor"href="#define-combo-strict-timer"aria-label="Permalink to "`#define COMBO_STRICT_TIMER`""></a></h4><p>With <code>COMBO_STRICT_TIMER</code>, the timer is started only on the first key press. Inputting combos is now less relaxed; you need to make sure the full chord is pressed within the <code>COMBO_TERM</code>. Misfires are less common but if you type multiple combos fast, there is a chance that the latter ones might not activate properly.</p><h4id="define-combo-no-timer"tabindex="-1"><code>#define COMBO_NO_TIMER</code><aclass="header-anchor"href="#define-combo-no-timer"aria-label="Permalink to "`#define COMBO_NO_TIMER`""></a></h4><p>By defining <code>COMBO_NO_TIMER</code>, the timer is disabled completely and combos are activated on the first key release. This also disables the "must hold" functionalities as they just wouldn't work at all.</p><h3id="customizable-key-releases"tabindex="-1">Customizable key releases <aclass="header-anchor"href="#customizable-key-releases"aria-label="Permalink to "Customizable key releases""></a></h3><p>By defining <code>COMBO_PROCESS_KEY_RELEASE</code> and implementing the function <code>bool process_combo_key_release(uint16_t combo_index, combo_t *combo, uint8_t key_index, uint16_t keycode)</code>, you can run your custom code on each key release after a combo was activated. For example you could change the RGB colors, activate haptics, or alter the modifiers.</p><p>You can also release a combo early by returning <code>true</code> from the function.</p><p>Here's an example where a combo resolves to two modifiers, and on key releases the modifiers are unregistered one by one, depending on which key was released.</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">enum</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> combos {</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> false</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // do not release combo</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3id="layer-independent-combos"tabindex="-1">Layer independent combos <aclass="header-anchor"href="#layer-independent-combos"aria-label="Permalink to "Layer independent combos""></a></h3><p>If you, for example, use multiple base layers for different key layouts, one for QWERTY, and another one for Colemak, you might want your combos to work from the same key positions on all layers. Defining the same combos again for another layout is redundant and takes more memory. The solution is to just check the keycodes from one layer.</p><p>With <code>#define COMBO_ONLY_FROM_LAYER 0</code> in config.h, the combos' keys are always checked from layer <code>0</code>, even if other layers are active.</p><h4id="combo-reference-layers-by-layer"tabindex="-1">Combo reference layers by layer. <aclass="header-anchor"href="#combo-reference-layers-by-layer"aria-label="Permalink to "Combo reference layers by layer.""></a></h4><p>If not using <code>COMBO_ONLY_FROM_LAYER</code> it is possible to specify a combo reference layer for any layer using the <code>combo_ref_from_layer</code> hook. The combo macros automatically create this function from the <code>COMBO_REF_LAYER()</code> entries given.</p><p>This function returns the assigned reference layer for the current layer. if there is no match, it returns the default reference layer if set, or the current layer otherwise. A default layer can be set with <code>DEFAULT_REF_LAYER(_MY_COMBO_REF_LAYER)</code></p><p>If not set, the default reference layer selection from the automatically generated <code>combo-ref-from-layer()</code> will be the current layer.</p><p>The following <code>combo_ref_from_layer</code> function will give a reference layer of _QWERTY for the _DVORAK layer and will give the _NAV layer as a reference to it's self. All other layers will have the default for their combo reference layer. If the default is not set, all other layers will reference themselves.</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> COMBO_REF_DEFAULT</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _MY_COMBO_LAYER</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> layer;</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // important if default is not in case.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>The equivalent definition using the combo macros is this:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">COMBO_REF_LAYER</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(_DVORAK, _QWERTY)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">DEFAULT_REF_LAYER</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(_MY_COMBO_LAYER).</span></span></code></pre></div><h2id="user-callbacks"tabindex="-1">User callbacks <aclass="header-anchor"href="#user-callbacks"aria-label="Permalink to "User callbacks""></a></h2><p>In addition to the keycodes, there are a few functions that you can use to set the status, or check it:</p><table><thead><tr><th>Function</th><th>Description</th></tr></thead><tbody><tr><td><code>combo_enable()</code></td><td>Enables the combo feature</td></tr><tr><td><code>combo_disable()</code></td><td>Disables the combo feature, and clears the combo buffer</td></tr><tr><td><code>combo_toggle()</code></td><td>Toggles the state of the combo feature</td></tr><tr><td><code>is_combo_enabled()</code></td><td>Returns the status of the combo feature state (true or false)</td></tr></tbody></table><h2id="dictionary-management"tabindex="-1">Dictionary Management <aclass="header-anchor"href="#dictionary-management"aria-label="Permalink to "Dictionary Management""></a></h2><p>Having 3 places to update when adding new combos or altering old ones does become cumbersome when you have a lot of combos. We can alleviate this with some magic! ... If you consider C macros magic. First, you need to add <code>VPATH += keyboards/gboards</code> to your <code>rules.mk</code>. Next, include the file <code>g/keymap_combo.h</code> in your <code>keymap.c</code>.</p><divclass="warning custom-block"><pclass="custom-block-title">WARNING</p><p>This functionality uses the same <code>process_combo_event</code> function as <code>COMBO_ACTION</code> macros do, so you cannot use the function yourself in your keymap. Instead, you have to define the <code>case</code>s of the <code>switch</code> statement by themselves within <code>inject.h</code>, which <code>g/keymap_combo.h</code> will then include into the function.</p></div><p>Then, write your combos in <code>combos.def</code> file in the following manner:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Alternate reference layers by layer</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">COMBO_REF_LAYER</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(_DVORAK, _QWERTY)</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // reference the qwerty layer for dvorak.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">COMBO_REF_LAYER</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(_NAV, _NAV)</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // explicit reference to self instead of the default.</span></span>
<spanclass="line"></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// name result chord keys</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">COMB</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(BSSL_CLR, KC_NO, KC_BSPC, KC_LSFT)</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // using KC_NO as the resulting keycode is the same as COMBO_ACTION before.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">SUBS</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(TH_THE, </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"the"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, KC_T, KC_H)</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // SUBS uses SEND_STRING to output the given string.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">...</span></span></code></pre></div><p>For small to huge ready made dictionaries of combos, you can check out <ahref="http://combos.gboards.ca/"target="_blank"rel="noreferrer">http://combos.gboards.ca/</a>.</p></div></div></main><footerclass="VPDocFooter"data-v-39a288b8data-v-09de1c0f><!--[--><!--]--><!----><navclass="prev-next"data-v-09de1c0f><divclass="pager"data-v-09de1c0f><aclass="VPLink link pager-link prev"href="/features/caps_word"data-v-09de1c0f><!--[--><spanclass="desc"data-v-09de1c0f>Previous page</span><spanclass="title"data-v-09de1c0f>Caps Word</span><!--]--></a></div><divclass="pager"data-v-09de1c0f><aclass="VPLink link pager-link next"href="/feature_debounce_type"data-v-09de1c0f><!--[--><spanclass="desc"data-v-09de1c0f>Next page</span><spanclass="title"data-v-09de1c0f>Debounce API</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>