mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-02-27 01:56:43 +00:00
16 lines
55 KiB
JavaScript
16 lines
55 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":"Adding Default Keymaps to QMK Configurator","description":"","frontmatter":{},"headers":[],"relativePath":"configurator_default_keymaps.md","filePath":"configurator_default_keymaps.md"}');
|
|||
|
const _sfc_main = { name: "configurator_default_keymaps.md" };
|
|||
|
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="adding-default-keymaps" tabindex="-1">Adding Default Keymaps to QMK Configurator <a class="header-anchor" href="#adding-default-keymaps" aria-label="Permalink to "Adding Default Keymaps to QMK Configurator {#adding-default-keymaps}""></a></h1><p>This page covers how to add a default keymap for a keyboard to QMK Configurator.</p><h2 id="technical-information" tabindex="-1">Technical Information <a class="header-anchor" href="#technical-information" aria-label="Permalink to "Technical Information {#technical-information}""></a></h2><p>QMK Configurator uses JSON as its native file format for keymaps. As much as possible, these should be kept such that they behave the same as running <code>make <keyboard>:default</code> from <code>qmk_firmware</code>.</p><p>Keymaps in this directory require four key-value pairs:</p><ul><li><code>keyboard</code> (string) <ul><li>This is the name of the keyboard, the same as would be used when running a compile job through <code>make</code> (e.g. <code>make 1upkeyboards/1up60rgb:default</code>).</li></ul></li><li><code>keymap</code> (string) <ul><li>Should be set to <code>default</code>.</li></ul></li><li><code>layout</code> (string) <ul><li>This is the layout macro used by the default keymap.</li></ul></li><li><code>layers</code> (array) <ul><li>The keymap itself. This key should contain one array per layer, which themselves should contain the keycodes that make up that layer.</li></ul></li></ul><p>Additionally, most keymaps contain a <code>commit</code> key. This key is not consumed by the API that back-stops QMK Configurator, but is used by Configurator's maintainers to tell which version of a keymap was used to create the JSON keymap in this repository. The value is the SHA of the last commit to modify a board's default <code>keymap.c</code> in the <code>qmk_firmware</code> repository. The SHA is found by checking out <a href="https://github.com/qmk/qmk_firmware/tree/master/" target="_blank" rel="noreferrer">the <code>master</code> branch of the <code>qmk/qmk_firmware</code> repository</a> and running <code>git log -1 --pretty=oneline -- keyboards/<keyboard>/keymaps/default/keymap.c</code> (use <code>keymap.json</code> if the keyboard in question has this file instead), which should return something similar to:</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>f14629ed1cd7c7ec9089604d64f29a99981558e8 Remove/migrate action_get_macro()s from default keymaps (#5625)</span></span></code></pre></div><p>In this example, <code>f14629ed1cd7c7ec9089604d64f29a99981558e8</code> is the value that should be used for <code>commit</code>.</p><h2 id="example" tabindex="-1">Example <a class="header-anchor" href="#example" aria-label="Permalink to "Example {#example}""></a></h2><p>If one wished to add a default keymap for the H87a by Hineybush, one would run the <code>git log</code> command above against the H87a's default keymap in <code>qmk_firmware</code>:</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>user ~/qmk_firmware (master)</span></span>\n<span class="line"><span>$ git log -1 --pretty=oneline master -- keyboards/hineybush/h87a/keymaps/default/keymap.c</span></span>\n<span class="line"><span>ef8878fba5d3786e3f9c66436da63a560cd36ac9 Hineybush h87a lock indicators (#8237)</span></span></code></pre></div><p>Now that we have the commit hash, we need the keymap (edited for readability):</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:#24292E;--shiki-dark:#E1E4E8;">...</
|
|||
|
const _hoisted_35 = [
|
|||
|
_hoisted_1
|
|||
|
];
|
|||
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
|
return openBlock(), createElementBlock("div", null, _hoisted_35);
|
|||
|
}
|
|||
|
const configurator_default_keymaps = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|||
|
export {
|
|||
|
__pageData,
|
|||
|
configurator_default_keymaps as default
|
|||
|
};
|