qmk_firmware/assets/feature_layouts.md.Cjp6pYRh.js

16 lines
10 KiB
JavaScript
Raw Normal View History

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.Clpp4x2N.js";
const __pageData = JSON.parse('{"title":"Layouts: Using a Keymap with Multiple Keyboards","description":"","frontmatter":{},"headers":[],"relativePath":"feature_layouts.md","filePath":"feature_layouts.md"}');
const _sfc_main = { name: "feature_layouts.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="layouts-using-a-keymap-with-multiple-keyboards" tabindex="-1">Layouts: Using a Keymap with Multiple Keyboards <a class="header-anchor" href="#layouts-using-a-keymap-with-multiple-keyboards" aria-label="Permalink to &quot;Layouts: Using a Keymap with Multiple Keyboards&quot;"></a></h1><p>The <code>layouts/</code> folder contains different physical key layouts that can apply to different keyboards.</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span>layouts/</span></span>\n<span class="line"><span>+ default/</span></span>\n<span class="line"><span>| + 60_ansi/</span></span>\n<span class="line"><span>| | + readme.md</span></span>\n<span class="line"><span>| | + layout.json</span></span>\n<span class="line"><span>| | + a_good_keymap/</span></span>\n<span class="line"><span>| | | + keymap.c</span></span>\n<span class="line"><span>| | | + readme.md</span></span>\n<span class="line"><span>| | | + config.h</span></span>\n<span class="line"><span>| | | + rules.mk</span></span>\n<span class="line"><span>| | + &lt;keymap folder&gt;/</span></span>\n<span class="line"><span>| | + ...</span></span>\n<span class="line"><span>| + &lt;layout folder&gt;/</span></span>\n<span class="line"><span>+ community/</span></span>\n<span class="line"><span>| + &lt;layout folder&gt;/</span></span>\n<span class="line"><span>| + ...</span></span></code></pre></div><p>The <code>layouts/default/</code> and <code>layouts/community/</code> are two examples of layout &quot;repositories&quot; - currently <code>default</code> will contain all of the information concerning the layout, and one default keymap named <code>default_&lt;layout&gt;</code>, for users to use as a reference. <code>community</code> contains all of the community keymaps, with the eventual goal of being split-off into a separate repo for users to clone into <code>layouts/</code>. QMK searches through all folders in <code>layouts/</code>, so it&#39;s possible to have multiple repositories here.</p><p>Each layout folder is named (<code>[a-z0-9_]</code>) after the physical aspects of the layout, in the most generic way possible, and contains a <code>readme.md</code> with the layout to be defined by the keyboard:</p><div class="language-markdown vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">markdown</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;--shiki-light-font-weight:bold;--shiki-dark-font-weight:bold;"># 60_ansi</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> LAYOUT_60_ansi</span></span></code></pre></div><p>New names should try to stick to the standards set by existing layouts, and can be discussed in the PR/Issue.</p><h2 id="supporting-a-layout" tabindex="-1">Supporting a Layout <a class="header-anchor" href="#supporting-a-layout" aria-label="Permalink to &quot;Supporting a Layout&quot;"></a></h2><p>For a keyboard to support a layout, the variable must be defined in it&#39;s <code>&lt;keyboard&gt;.h</code>, and match the number of arguments/keys (and preferably the physical layout):</p><div class="language-c vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> LAYOUT_60_ansi</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KEYMAP_ANSI</span></span></code></pre></div><p>The name of the layout must match this regex: <code>[a-z0-9_]+</code></p><p>The folder name must be added to the keyboard&#39;s <code>rules.mk</code>:</p><div class="language- vp-adaptive-theme"><button tit
const _hoisted_38 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_38);
}
const feature_layouts = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
feature_layouts as default
};