<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3id="selecting-your-host-keyboard-layout"tabindex="-1">Selecting Your Host Keyboard Layout <aclass="header-anchor"href="#selecting-your-host-keyboard-layout"aria-label="Permalink to "Selecting Your Host Keyboard Layout""></a></h3><p>If you type in a language other than English, or use a non-QWERTY layout like Colemak, Dvorak, or Workman, you may have set your computer's input language to match this layout. This presents a challenge when creating macros — you may need to type different keys to get the same letters! To address this you can use <ahref="./reference_keymap_extras">language-specific keycodes</a>.</p><h3id="macro-basics"tabindex="-1">Macro Basics <aclass="header-anchor"href="#macro-basics"aria-label="Permalink to "Macro Basics""></a></h3><p>Each macro is an array consisting of strings and objects (dictionaries). Strings are typed to your computer while objects allow you to control how your macro is typed out.</p><h4id="object-format"tabindex="-1">Object Format <aclass="header-anchor"href="#object-format"aria-label="Permalink to "Object Format""></a></h4><p>All objects have one required key: <code>action</code>. This tells QMK what the object does. There are currently 5 actions: beep, delay, down, tap, up</p><p>Only basic keycodes (prefixed by <code>KC_</code>) are supported. Do not include the <code>KC_</code> prefix when listing keycodes.</p><ul><li><code>beep</code><ul><li>Play a bell if the keyboard has <ahref="./features/audio">audio enabled</a>.</li><li>Example: <code>{"action": "beep"}</code></li></ul></li><li><code>delay</code><ul><li>Pause macro playback. Duration is specified in milliseconds (ms).</li><li>Example: <code>{"action": "delay", "duration": 500}</code></li></ul></li><li><code>down</code><ul><li>Send a key down event for one or more keycodes.</li><li>Example, single key: <code>{"action":"down", "keycodes": ["LSFT"]}</code></li><li>Example, multiple keys: <code>{"action":"down", "keycodes": ["CTRL", "LSFT"]}</code></li></ul></li><li><code>tap</code><ul><li>Type a chord, which sends a down event for each key followed by an up event for each key.</li><li>Example, single key: <code>{"action":"tap", "keycodes": ["F13"]}</code></li><li>Example, multiple keys: <code>{"action":"tap", "keycodes": ["CTRL", "LALT", "DEL"]}</code></li></ul></li><li><code>up</code><ul><li>Send a key up event for one or more keycodes.</li><li>Example, single key: <code>{"action":"up", "keycodes": ["LSFT"]}</code></li><li>Example, multiple keys: <code>{"action":"up", "keycodes": ["CTRL", "LSFT"]}</code></li></ul></li></ul><h2id="using-macros-in-c-keymaps"tabindex="-1">Using Macros in C Keymaps <aclass="header-anchor"href="#using-macros-in-c-keymaps"aria-label="Permalink to "Using Macros in C Keymaps""></a></h2><h3id="send-string-process-record-user"tabindex="-1"><code>SEND_STRING()</code>&<code>process_record_user</code><aclass="header-anchor"href="#send-string-process-record-user"aria-label="Permalink to "`SEND_STRING()` & `process_record_user`""></a></h3><p>See also: <ahref="./features/send_string">Send String</a></p><p>Sometimes you want a key to type out words or phrases. For the most common situations, we've provided <code>SEND_STRING()</code>, which will type out a string (i.e. a sequence of characters) for you. All ASCII characters that are easily translatable to a keycode are supported (e.g. <code>qmk 123\n\t</code>).</p><p>Here is an example <code>keymap.c</code> for a two-key keyboard:</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // when keycode QMKBEST is pressed</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SEND_STRING</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"QMK is the best thing ever!"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><p>What happens here is this: We first define a new custom keycode in the range not occupied by any other keycodes. Then we use the <code>process_record_user</code> function, which is called whenever a key is pressed or released, to check if our custom keycode has been activated. If yes, we send the string <code>"QMK is the best thing ever!"</code> to the computer via the <code>SEND_STRING</code> macro (this is a C preprocessor macro, not to be confused with QMK macros). We return <code>true</code> to indicate to the caller that the key press we just processed should continue to be processed as normal (as we didn't replace or alter the functionality). Finally, we define the keymap so that the first button activates our macro and the second button is just an escape button.</p><p>?>It is recommended to use the SAFE_RANGE macro as per <ahref="./custom_quantum_functions">Customizing Functionality</a>.</p><p>You might want to add more than one macro. You can do that by adding another keycode and adding another case to the switch statement, like so:</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;"> custom_keycodes {</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // when keycode QMKBEST is pressed</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SEND_STRING</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"QMK is the best thing ever!"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SEND_STRING</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">SS_LCTL</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ac"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">));</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // selects all and copies</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><divclass="tip custom-block"><pclass="custom-block-title">TIP</p><p>An enumerated list of custom keycodes (<code>enum custom_keycodes</code>) must be declared before <code>keymaps[]</code> array, <code>process_record_user()</code> and any other function that use the list for the compiler to recognise it.</p></div><h4id="advanced-macros"tabindex="-1">Advanced Macros <aclass="header-anchor"href="#advanced-macros"aria-label="Permalink to "Advanced Macros""></a></h4><p>In addition to the <code>process_record_user()</code> function, is the <code>post_process_record_user()</code> function. This runs after <code>process_record</code> and can be used to do things after a keystroke has been sent. This is useful if you want to have a key pressed before and released after a normal key, for instance.</p><p>In this example, we modify most normal keypresses so that <code>F22</code> is pressed before the keystroke is normally sent, and release it <strong>only after</strong> it's been 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;">static</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> uint8_t</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> f22_tracker;</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> case</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KC_A ... KC_F21:</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //notice how it skips over F22</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> case</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KC_F23 ... KC_EXSEL:</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //exsel is the last one before the modifier keys</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> register_code</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(KC_F22);</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //this means to send F22 down</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> case</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KC_A ... KC_F21:</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //notice how it skips over F22</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> case</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KC_F23 ... KC_EXSL:</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //exsel is the last one before the modifier keys</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> unregister_code</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(KC_F22);</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //this means to send F22 up</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h4id="tap-down-and-up"tabindex="-1">TAP, DOWN and UP <aclass="header-anchor"href="#tap-down-and-up"aria-label="Permalink to "TAP, DOWN and UP""></a></h4><p>You may want to use keys in your macros that you can't write down, such as <code>Ctrl</code> or <code>Home</code>. You can send arbitrary keycodes by wrapping them in:</p><ul><li><code>SS_TAP()</code> presses and releases a key.</li><li><code>SS_DOWN()</code> presses (but does not release) a key.</li><li><code>SS_UP()</code> releases a key.</li></ul><p>For example:</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;">SEND_STRING</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">SS_TAP</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(X_HOME));</span></span></code></pre></div><p>Would tap <code>KC_HOME</code> - note how the prefix is now <code>X_</code>, and not <code>KC_</code>. You can also combine this with other strings, like 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;">SEND_STRING</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"VE"</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">SS_TAP</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(X_HOME)</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LO"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span></code></pre></div><p>Which would send "VE" followed by a <code>KC_HOME</code> tap, and "LO" (spelling "LOVE" if on a newline).</p><p>Delays can be also added to the string:</p><ul><li><code>SS_DELAY(msecs)</code> will delay for the specified number of milliseconds.</li></ul><p>For example:</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;">SEND_STRING</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"VE"</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SS_DELAY</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1000</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) </span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">SS_TAP</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(X_HOME) </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LO"</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">);</span></span></code></pre></div><p>Which would send "VE" followed by a 1-second delay, then a <code>KC_HOME</code> tap, and "LO" (spelling "LOVE" if on a newline, but delayed in the middle).</p><p>There's also a couple of mod shortcuts you can use:</p><ul><li><code>SS_LCTL(string)</code></li><li><code>SS_LSFT(string)</code></li><li><code>SS_LALT(string)</code> or <code>SS_LOPT(string)</code></li><li><code>SS_LGUI(string)</code>, <code>SS_LCMD(string)</code> or <code>SS_LWIN(string)</code></li><li><code>SS_RCTL(string)</code></li><li><code>SS_RSFT(string)</code></li><li><code>SS_RALT(string)</code>, <code>SS_ROPT(string)</code> or <code>SS_ALGR(string)</code></li><li
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">send_string</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(my_str);</span></span></code></pre></div><p>The shortcuts defined above won't work with <code>send_string()</code>, but you can separate things out to different lines if needed:</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;">char</span><spanstyle="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> my_str</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">4</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"ok."</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">SEND_STRING</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">".."</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">SS_TAP</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(X_END));</span></span></code></pre></div><h3id="advanced-macro-functions"tabindex="-1">Advanced Macro Functions <aclass="header-anchor"href="#advanced-macro-functions"aria-label="Permalink to "Advanced Macro Functions""></a></h3><p>There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro, if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.</p><divclass="tip custom-block"><pclass="custom-block-title">TIP</p><p>You can also use the functions described in <ahref="./ref_functions">Useful function</a> and <ahref="./feature_advanced_keycodes#checking-modifier-state">Checking modifier state</a> for additional functionality. For example, <code>reset_keyboard()</code> allows you to reset the keyboard as part of a macro and <code>get_mods() & MOD_MASK_SHIFT</code> lets you check for the existence of active shift modifiers.</p></div><h4id="record-event-pressed"tabindex="-1"><code>record->event.pressed</code><aclass="header-anchor"href="#record-event-pressed"aria-label="Permalink to "`record->event.pressed`""></a></h4><p>This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is</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;"> if</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (record</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">-></span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">event.pressed) {</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // on keydown</span></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // on keyup</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span></code></pre></div><h4id="register-code-kc"tabindex="-1"><code>register_code(<kc>);</code><aclass="header-anchor"href="#register-code-kc"aria-label="Permalink to "`register_code(<kc>);`""></a></h4><p>This sends the <code><kc></code> keydown event to the computer. Some examples would be <code>KC_ESC</code>, <code>KC_C</code>, <code>KC_4</code>, and even modifiers such as <code>KC_LSFT</code> and <code>KC_LGUI</code>.</p><h4id="unregister-code-kc"tabindex="-1"><code>unregister_code(<kc>);</code><aclass="header-anchor"href="#unregister-code-kc"aria-label="Permalink to "`unregister_code(<kc>);`""></a></h4><p>Parallel to <code>register_code</code> function, this sends the <code><kc></code> keyup event to the computer. If you don't use this, the key will be held down until it's sent.</p><h4id="tap-code-kc"tabindex="-1"><code>tap_code(<kc>);</code><aclass="header-anchor"href="#tap-code-kc"aria-label="Permalink to "`tap_code(<kc>);`""></a></h4><p>Sends <code>register_code(<kc>)</code> and then <code>unregister_code(<kc>)</code>. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it).</p><p>If <code>TAP_CODE_DELAY</code> is defined (default 0), this function waits that many milliseconds before calling <code>unregister_code(<kc>)</code>. This can be useful when you are having issues with taps (un)registering.</p><p>If the keycode is <code>KC_CAPS</code>, it waits <code>TAP_HOLD_CAPS_DELAY</code> milliseconds instead (default 80), as macOS prevents accidental Caps Lock activation by waiting for the key to be held for a certain amount of time.</p><h4id="tap-code-delay-kc-delay"tabindex="-1"><code>tap_code_delay(<kc>, <delay>);</code><aclass="header-anchor"href="#tap-code-delay-kc-delay"aria-label="Permalink to "`tap_code_delay(<kc>, <delay>);`""></a></h4><p>Like <code>tap_code(<kc>)</code>, but with a <code>delay</code> parameter for specifying arbitrary intervals before sending the unregister event.</p><h4id="register-code16-kc-unregister-code16-kc-tap-code16-kc-and-tap-code16-delay-kc-delay"tabindex="-1"><code>register_code16(<kc>);</code>, <code>unregister_code16(<kc>);</code>, <code>tap_code16(<kc>);</code> and <code>tap_code16_delay(<kc>, <delay>);</code><aclass="header-anchor"href="#register-code16-kc-unregister-code16-kc-tap-code16-kc-and-tap-code16-delay-kc-delay"aria-label="Permalink to "`register_code16(<kc>);`, `unregister_code16(<kc>);`, `tap_code16(<kc>);` and `tap_code16_delay(<kc>, <delay>);`""></a></h4><p>These functions work similar to their regular counterparts, but allow you to use modded keycodes (with Shift, Alt, Control, and/or GUI applied to them).</p><p>Eg, you could use <code>register_code16(S(KC_5));</code> instead of registering the mod, then registering the keycode.</p><h4id="clear-keyboard"tabindex="-1"><code>clear_keyboard();</code><aclass="header-anchor"href="#clear-keyboard"aria-label="Permalink to "`clear_keyboard();`""></a></h4><p>This will clear all mods and keys currently pressed.</p><h4id="clear-mods"tabindex="-1"><code>clear_mods();</code><aclass="header-anchor"href="#clear-mods"aria-label="Permalink to "`clear_mods();`""></a></h4><p>This will clear all mods currently pressed.</p><h4id="clear-keyboard-but-mods"tabindex="-1"><code>clear_keyboard_but_mods();</code><aclass="header-anchor"href="#clear-keyboard-but-mods"aria-label="Permalink to "`clear_keyboard_but_mods();`""></a></h4><p>This will clear all keys besides the mods currently pressed.</p><h3id="advanced-example"tabindex="-1">Advanced Example: <aclass="header-anchor"href="#advanced-example"aria-label="Permalink to "Advanced Example:""></a></h3><h4id="supe
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">uint16_t</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> alt_tab_timer </span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // we will be using them soon.</span></span>
<spanclass="line"></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">enum</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> custom_keycodes {</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // Make sure have the awesome keycode ready</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;"> switch</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (keycode) {</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // This will do most of the grunt work with the keycodes.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">void</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> matrix_scan_user</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">void</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // The very important timer.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div></div></div></main><footerclass="VPDocFooter"data-v-39a288b8data-v-09de1c0f><!--[--><!--]--><divclass="edit-info"data-v-09de1c0f><divclass="edit-link"data-v-09de1c0f><aclass="VPLink link vp-external-link-icon no-icon edit-link-button"href="https://github.com/qmk/qmk_firmware/edit/master/docs/feature_macros.md"target="_blank"rel="noreferrer"data-v-09de1c0f><!--[--><spanclass="vpi-square-pen edit-link-icon"data-v-09de1c0f></span> Edit this page<!--]--></a></div><!----></div><navclass="prev-next"data-v-09de1c0f><divclass="pager"data-v-09de1c0f><aclass="VPLink link pager-link prev"href="/mod_tap"data-v-09de1c0f><!--[--><spanclass="desc"data-v-09de1c0f>Previous page</span><spanclass="title"data-v-09de1c0f>Mod-Tap</span><!--]--></a></div><divclass="pager"data-v-09de1c0f><aclass="VPLink link pager-link next"href="/features/mouse_keys"data-v-09de1c0f><!--[--><spanclass="desc"data-v-09de1c0f>Next page</span><spanclass="title"data-v-09de1c0f>Mouse Keys</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>