qmk_firmware/assets/reference_keymap_extras.md.D-__wuxf.js

16 lines
11 KiB
JavaScript
Raw Normal View History

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
const __pageData = JSON.parse('{"title":"Language-specific Keycodes","description":"","frontmatter":{},"headers":[],"relativePath":"reference_keymap_extras.md","filePath":"reference_keymap_extras.md"}');
const _sfc_main = { name: "reference_keymap_extras.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="language-specific-keycodes" tabindex="-1">Language-specific Keycodes <a class="header-anchor" href="#language-specific-keycodes" aria-label="Permalink to &quot;Language-specific Keycodes&quot;"></a></h1><p>Keyboards are able to support a wide range of languages. However, this support is not actually achieved within the keyboard itself - instead, it sends numerical codes, which the operating system maps to the appropriate characters depending on the user&#39;s configured keyboard layout. By default (and per the HID spec), this is the US ANSI layout. For example, when a Swedish person presses the key with the <code>å</code> character printed on it, the keyboard is <em>actually</em> sending the keycode for <code>[</code>.</p><p>Obviously, this can get confusing, so QMK provides language-specific keycode aliases for many keyboard layouts. These won&#39;t do much on their own - you still have to set the matching keyboard layout in your OS settings. Think of them more as keycap labels for your keymap.</p><p>Simply <code>#include</code> one of the keycode headers below at the top of your <code>keymap.c</code>, and assign the keycodes defined in the header in place of the <code>KC_</code> prefixed ones.</p><h2 id="sendstring-support" tabindex="-1">Sendstring Support <a class="header-anchor" href="#sendstring-support" aria-label="Permalink to &quot;Sendstring Support&quot;"></a></h2><p>By default, <code>SEND_STRING()</code> assumes a US ANSI keyboard layout is set. If you are using a different layout, you can include one of the Sendstring LUT headers below in your <code>keymap.c</code> to override the lookup tables used for mapping ASCII characters to keycodes. You do not need to include the corresponding <code>keymap_*.h</code> header, as it is implicit when including the Sendstring header.</p><p>An important thing to note here is that <code>SEND_STRING()</code> only operates on <a href="https://en.wikipedia.org/wiki/ASCII#Character_set" target="_blank" rel="noreferrer">ASCII text</a>. This means that you cannot pass it a string containing Unicode characters - this unfortunately includes accented characters that may be present in your desired layout.<br> Many layouts make certain characters, such as Grave or Tilde, available only as <a href="https://en.wikipedia.org/wiki/Dead_key" target="_blank" rel="noreferrer">dead keys</a>, so you must add a space immediately after it in the string you want to send, to prevent it from potentially combining with the next character.<br> Certain other layouts have no Sendstring header as they do not use a Latin-derived alphabet (for example Greek and Russian), and thus there is no way to input most of the ASCII character set.</p><h2 id="header-files" tabindex="-1">Header Files <a class="header-anchor" href="#header-files" aria-label="Permalink to &quot;Header Files&quot;"></a></h2><p>These headers are located in <a href="https://github.com/qmk/qmk_firmware/tree/master/quantum/keymap_extras" target="_blank" rel="noreferrer"><code>quantum/keymap_extras/</code></a>.</p><table><thead><tr><th>Layout</th><th>Keycodes Header</th><th>Sendstring LUT Header</th></tr></thead><tbody><tr><td>Canadian Multilingual (CSA)</td><td><code>keymap_canadian_multilingual.h</code></td><td><code>sendstring_canadian_multilingual.h</code></td></tr><tr><td>Croatian</td><td><code>keymap_croatian.h</code></td><td><code>sendstring_croatian.h</code></td></tr><tr><td>Czech</td><td><code>keymap_czech.h</code></td><td><code>sendstring_czech.h</code></td></tr><tr><td>Czech (macOS, ANSI)</td><td><code>keymap_czech_mac_ansi.h</code></td><td><code>sendstring_czech_mac_ansi.h</code></td></tr><tr><td>Czech (macOS, ISO)</td><td><code>keymap_czech_mac_iso.h</code></td><td><code>sendstring_czech_mac_iso.h</code></td></tr><tr><td>Danish</td><td><code>keymap_danish.h</code></td><td><code>sendstring_danish.h</code></td></tr><tr><td>Dutch (Belgium)</td><td><code>keymap_belgian.h</code></td><td><code>sendstring_belgian.h</code></td></tr><tr><td>English (Ireland)</td><td>
const _hoisted_13 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_13);
}
const reference_keymap_extras = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
reference_keymap_extras as default
};