2024-09-18 08:58:07 +00:00
|
|
|
|
import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.Clpp4x2N.js";
|
2024-06-02 02:43:43 +00:00
|
|
|
|
const __pageData = JSON.parse('{"title":"Send String","description":"","frontmatter":{},"headers":[],"relativePath":"features/send_string.md","filePath":"features/send_string.md"}');
|
|
|
|
|
const _sfc_main = { name: "features/send_string.md" };
|
|
|
|
|
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="send-string" tabindex="-1">Send String <a class="header-anchor" href="#send-string" aria-label="Permalink to "Send String {#send-string}""></a></h1><p>The Send String API is part of QMK's macro system. It allows for sequences of keystrokes to be sent automatically.</p><p>The full ASCII character set is supported, along with all of the keycodes in the Basic Keycode range (as these are the only ones that will actually be sent to the host).</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>Unicode characters are <strong>not</strong> supported with this API -- see the <a href="./unicode">Unicode</a> feature instead.</p></div><h2 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to "Usage {#usage}""></a></h2><p>Send String is enabled by default, so there is usually no need for any special setup. However, if it is disabled, add the following to your <code>rules.mk</code>:</p><div class="language-make vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">make</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">SEND_STRING_ENABLE = yes</span></span></code></pre></div><h2 id="basic-configuration" tabindex="-1">Basic Configuration <a class="header-anchor" href="#basic-configuration" aria-label="Permalink to "Basic Configuration {#basic-configuration}""></a></h2><p>Add the following to your <code>config.h</code>:</p><table><thead><tr><th>Define</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>SENDSTRING_BELL</code></td><td><em>Not defined</em></td><td>If the <a href="./audio">Audio</a> feature is enabled, the <code>\\a</code> character (ASCII <code>BEL</code>) will beep the speaker.</td></tr><tr><td><code>BELL_SOUND</code></td><td><code>TERMINAL_SOUND</code></td><td>The song to play when the <code>\\a</code> character is encountered. By default, this is an eighth note of C5.</td></tr></tbody></table><h2 id="keycodes" tabindex="-1">Keycodes <a class="header-anchor" href="#keycodes" aria-label="Permalink to "Keycodes {#keycodes}""></a></h2><p>The Send String functions accept C string literals, but specific keycodes can be injected with the below macros. All of the keycodes in the <a href="./../keycodes_basic">Basic Keycode range</a> are supported (as these are the only ones that will actually be sent to the host), but with an <code>X_</code> prefix instead of <code>KC_</code>.</p><table><thead><tr><th>Macro</th><th>Description</th></tr></thead><tbody><tr><td><code>SS_TAP(x)</code></td><td>Send a keydown, then keyup, event for the given Send String keycode</td></tr><tr><td><code>SS_DOWN(x)</code></td><td>Send a keydown event for the given Send String keycode</td></tr><tr><td><code>SS_UP(x)</code></td><td>Send a keyup event for the given Send String keycode</td></tr><tr><td><code>SS_DELAY(ms)</code></td><td>Wait for <code>ms</code> milliseconds</td></tr></tbody></table><p>The following characters are also mapped to their respective keycodes for convenience:</p><table><thead><tr><th>Character</th><th>Hex</th><th>ASCII</th><th>Keycode</th></tr></thead><tbody><tr><td><code>\\b</code></td><td><code>\\x08</code></td><td><code>BS</code></td><td><code>KC_BACKSPACE</code></td></tr><tr><td><code>\\e</code></td><td><code>\\x09</code></td><td><code>ESC</code></td><td><code>KC_ESCAPE</code></td></tr><tr><td><code>\\n</code></td><td><code>\\x0A</code></td><td><code>LF</code></td><td><code>KC_ENTER</code></td></tr><tr><td><code>\\t</code></td><td><code>\\x1B</code></td><td><code>TAB</code></td><td><code>KC_TAB</code></td></tr><tr><td></td><td><code>\\x7F</code></td><td><code>DEL</code></td><td><code>KC_DELETE</code></td></tr></tbody></table><h3 id="language-support" tabindex="-1">Language Support <a class="header-anchor" href="#language-support" aria-label="Permalink to "Language Support {#language-support}&
|
|
|
|
|
const _hoisted_91 = [
|
|
|
|
|
_hoisted_1
|
|
|
|
|
];
|
|
|
|
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
|
|
return openBlock(), createElementBlock("div", null, _hoisted_91);
|
|
|
|
|
}
|
|
|
|
|
const send_string = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
|
|
|
export {
|
|
|
|
|
__pageData,
|
|
|
|
|
send_string as default
|
|
|
|
|
};
|