qmk_firmware/assets/tap_hold.md.C51tVJEM.js

16 lines
63 KiB
JavaScript
Raw Normal View History

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.B9AX-CPi.js";
const __pageData = JSON.parse('{"title":"Tap-Hold Configuration Options","description":"","frontmatter":{},"headers":[],"relativePath":"tap_hold.md","filePath":"tap_hold.md","lastUpdated":null}');
const _sfc_main = { name: "tap_hold.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="tap-hold-configuration-options" tabindex="-1">Tap-Hold Configuration Options <a class="header-anchor" href="#tap-hold-configuration-options" aria-label="Permalink to &quot;Tap-Hold Configuration Options&quot;"></a></h1><p>While Tap-Hold options are fantastic, they are not without their issues. We have tried to configure them with reasonable defaults, but that may still cause issues for some people.</p><p>These options let you modify the behavior of the Tap-Hold keys.</p><h2 id="tapping-term" tabindex="-1">Tapping Term <a class="header-anchor" href="#tapping-term" aria-label="Permalink to &quot;Tapping Term&quot;"></a></h2><p>The crux of all of the following features is the tapping term setting. This determines what is a tap and what is a hold. The exact timing for this to feel natural can vary from keyboard to keyboard, from switch to switch, and from key to key.</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p><code>DYNAMIC_TAPPING_TERM_ENABLE</code> enables three special keys that can help you quickly find a comfortable tapping term for you. See &quot;Dynamic Tapping Term&quot; for more details.</p></div><p>You can set the global time for this by adding the following setting to your <code>config.h</code>:</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;"> TAPPING_TERM</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 200</span></span></code></pre></div><p>This setting is defined in milliseconds and defaults to 200ms. This is a good average for the majority of people.</p><p>For more granular control of this feature, you can add the following to your <code>config.h</code>:</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;"> TAPPING_TERM_PER_KEY</span></span></code></pre></div><p>You can then add the following function to your keymap:</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;">uint16_t</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_tapping_term</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">uint16_t</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> keycode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">keyrecord_t</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">record</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> switch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (keycode) {</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> case</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SFT_T</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(KC_SPC):</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> TAPPING_TERM </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC
const _hoisted_126 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_126);
}
const tap_hold = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
tap_hold as default
};