mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-02-27 01:56:43 +00:00
16 lines
66 KiB
JavaScript
16 lines
66 KiB
JavaScript
|
import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
|
|||
|
const __pageData = JSON.parse('{"title":"Macros","description":"","frontmatter":{},"headers":[],"relativePath":"feature_macros.md","filePath":"feature_macros.md"}');
|
|||
|
const _sfc_main = { name: "feature_macros.md" };
|
|||
|
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="macros" tabindex="-1">Macros <a class="header-anchor" href="#macros" aria-label="Permalink to "Macros""></a></h1><p>Macros allow you to send multiple keystrokes when pressing just one key. QMK has a number of ways to define and use macros. These can do anything you want: type common phrases for you, copypasta, repetitive game movements, or even help you code.</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p><strong>Security Note</strong>: While it is possible to use macros to send passwords, credit card numbers, and other sensitive information it is a supremely bad idea to do so. Anyone who gets a hold of your keyboard will be able to access that information by opening a text editor.</p></div><h2 id="using-macros-in-json-keymaps" tabindex="-1">Using Macros In JSON Keymaps <a class="header-anchor" href="#using-macros-in-json-keymaps" aria-label="Permalink to "Using Macros In JSON Keymaps""></a></h2><p>You can define up to 32 macros in a <code>keymap.json</code> file, as used by <a href="./newbs_building_firmware_configurator">Configurator</a>, and <code>qmk compile</code>. You can define these macros in a list under the <code>macros</code> keyword, like this:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>\n<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "keyboard"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"handwired/my_macropad"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>\n<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "keymap"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"my_keymap"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>\n<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "macros"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">"action"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"down"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">"keycodes"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LSFT"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]},</span></span>\n<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "hello world1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">"action"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"up"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">"keycodes"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"LSFT"</span><span style="-
|
|||
|
const _hoisted_88 = [
|
|||
|
_hoisted_1
|
|||
|
];
|
|||
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
|
return openBlock(), createElementBlock("div", null, _hoisted_88);
|
|||
|
}
|
|||
|
const feature_macros = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|||
|
export {
|
|||
|
__pageData,
|
|||
|
feature_macros as default
|
|||
|
};
|