16 lines
41 KiB
JavaScript
16 lines
41 KiB
JavaScript
import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.B9AX-CPi.js";
|
||
const __pageData = JSON.parse('{"title":"Auto Shift: Why Do We Need a Shift Key?","description":"","frontmatter":{},"headers":[],"relativePath":"features/auto_shift.md","filePath":"features/auto_shift.md","lastUpdated":null}');
|
||
const _sfc_main = { name: "features/auto_shift.md" };
|
||
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="auto-shift-why-do-we-need-a-shift-key" tabindex="-1">Auto Shift: Why Do We Need a Shift Key? <a class="header-anchor" href="#auto-shift-why-do-we-need-a-shift-key" aria-label="Permalink to "Auto Shift: Why Do We Need a Shift Key?""></a></h1><p>Tap a key and you get its character. Tap a key, but hold it <em>slightly</em> longer and you get its shifted state. Voilà! No shift key needed!</p><h2 id="why-auto-shift" tabindex="-1">Why Auto Shift? <a class="header-anchor" href="#why-auto-shift" aria-label="Permalink to "Why Auto Shift?""></a></h2><p>Many people suffer from various forms of RSI. A common cause is stretching your fingers repetitively long distances. For us on the keyboard, the pinky does that all too often when reaching for the shift key. Auto Shift looks to alleviate that problem.</p><h2 id="how-does-it-work" tabindex="-1">How Does It Work? <a class="header-anchor" href="#how-does-it-work" aria-label="Permalink to "How Does It Work?""></a></h2><p>When you tap a key, it stays depressed for a short period of time before it is then released. This depressed time is a different length for everyone. Auto Shift defines a constant <code>AUTO_SHIFT_TIMEOUT</code> which is typically set to twice your normal pressed state time. When you press a key, a timer starts, and if you have not released the key after the <code>AUTO_SHIFT_TIMEOUT</code> period, then a shifted version of the key is emitted. If the time is less than the <code>AUTO_SHIFT_TIMEOUT</code> time, or you press another key, then the normal state is emitted.</p><p>If <code>AUTO_SHIFT_REPEAT</code> is defined, there is keyrepeat support. Holding the key down will repeat the shifted key, though this can be disabled with <code>AUTO_SHIFT_NO_AUTO_REPEAT</code>. If you want to repeat the normal key, then tap it once then immediately (within <code>TAPPING_TERM</code>) hold it down again (this works with the shifted value as well if auto-repeat is disabled).</p><p>There are also the <code>get_auto_shift_repeat</code> and <code>get_auto_shift_no_auto_repeat</code> functions for more granular control. Neither will have an effect unless <code>AUTO_SHIFT_REPEAT_PER_KEY</code> or <code>AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY</code> respectively are defined.</p><h2 id="are-there-limitations-to-auto-shift" tabindex="-1">Are There Limitations to Auto Shift? <a class="header-anchor" href="#are-there-limitations-to-auto-shift" aria-label="Permalink to "Are There Limitations to Auto Shift?""></a></h2><p>Yes, unfortunately.</p><ol><li>You will have characters that are shifted when you did not intend on shifting, and other characters you wanted shifted, but were not. This simply comes down to practice. As we get in a hurry, we think we have hit the key long enough for a shifted version, but we did not. On the other hand, we may think we are tapping the keys, but really we have held it for a little longer than anticipated.</li><li>Additionally, with keyrepeat the desired shift state can get mixed up. It will always 'belong' to the last key pressed. For example, keyrepeating a capital and then tapping something lowercase (whether or not it's an Auto Shift key) will result in the capital's <em>key</em> still being held, but shift not.</li><li>Auto Shift does not apply to Tap Hold keys. For automatic shifting of Tap Hold keys see <a href="#retro-shift">Retro Shift</a>.</li></ol><h2 id="how-do-i-enable-auto-shift" tabindex="-1">How Do I Enable Auto Shift? <a class="header-anchor" href="#how-do-i-enable-auto-shift" aria-label="Permalink to "How Do I Enable Auto Shift?""></a></h2><p>Add to your <code>rules.mk</code> in the keymap folder:</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>AUTO_SHIFT_ENABLE = yes</span></span></code></pre></div><p>If no <code>rules.mk</code> exists, you can create one.</p><p>Then compile and install your new firmware with Auto Key enabled! That's it!</p><h2 id="modifiers" tabindex="-1">Modifiers <a class="header-anchor" href="#modifiers" aria-label="Permalink to "Modifiers""></a></h2><p>By default, Auto Shift is disabled for any key press that is accompanied by one or more modifiers. Thus, Ctrl+A that you hold for a really long time is not the same as Ctrl+Shift+A.</p><p>You can re-enable Auto Shift for modifiers by adding a define 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;"> AUTO_SHIFT_MODIFIERS</span></span></code></pre></div><p>In which case, Ctrl+A held past the <code>AUTO_SHIFT_TIMEOUT</code> will be sent as Ctrl+Shift+A</p><h2 id="configuring-auto-shift" tabindex="-1">Configuring Auto Shift <a class="header-anchor" href="#configuring-auto-shift" aria-label="Permalink to "Configuring Auto Shift""></a></h2><p>If desired, there is some configuration that can be done to change the behavior of Auto Shift. This is done by setting various variables the <code>config.h</code> file located in your keymap folder. If no <code>config.h</code> file exists, you can create one.</p><p>A sample is</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;">#pragma</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> once</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> AUTO_SHIFT_TIMEOUT</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 150</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> NO_AUTO_SHIFT_SPECIAL</span></span></code></pre></div><h3 id="auto-shift-timeout-value-in-ms" tabindex="-1">AUTO_SHIFT_TIMEOUT (Value in ms) <a class="header-anchor" href="#auto-shift-timeout-value-in-ms" aria-label="Permalink to "AUTO_SHIFT_TIMEOUT (Value in ms)""></a></h3><p>This controls how long you have to hold a key before you get the shifted state. Obviously, this is different for everyone. For the common person, a setting of 135 to 150 works great. However, one should start with a value of at least 175, which is the default value. Then work down from there. The idea is to have the shortest time required to get the shifted state without having false positives.</p><p>Play with this value until things are perfect. Many find that all will work well at a given value, but one or two keys will still emit the shifted state on occasion. This is simply due to habit and holding some keys a little longer than others. Once you find this value, work on tapping your problem keys a little quicker than normal and you will be set.</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>Auto Shift has three special keys that can help you get this value right very quick. See "Auto Shift Setup" for more details!</p></div><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;"> AUTO_SHIFT_TIMEOUT_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_autoshift_timeout</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:#24292E;--shiki-dark:#E1E4E8;"> AUTO_SHIFT_NUMERIC:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_generic_autoshift_timeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> case</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AUTO_SHIFT_SPECIAL:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_generic_autoshift_timeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 50</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> case</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> AUTO_SHIFT_ALPHA:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_generic_autoshift_timeout</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></code></pre></div><p>Note that you cannot override individual keys that are in one of those groups if you are using them; trying to add a case for <code>KC_A</code> in the above example will not compile as <code>AUTO_SHIFT_ALPHA</code> is there. A possible solution is a second switch above to handle individual keys with no default case and only referencing the groups in the below fallback switch.</p><h3 id="no-auto-shift-special-simple-define" tabindex="-1">NO_AUTO_SHIFT_SPECIAL (simple define) <a class="header-anchor" href="#no-auto-shift-special-simple-define" aria-label="Permalink to "NO_AUTO_SHIFT_SPECIAL (simple define)""></a></h3><p>Do not Auto Shift special keys, which include -_, =+, [{, ]}, ;:, '", ,<, .>, /?, and the KC_TAB.</p><h3 id="no-auto-shift-tab-simple-define" tabindex="-1">NO_AUTO_SHIFT_TAB (simple define) <a class="header-anchor" href="#no-auto-shift-tab-simple-define" aria-label="Permalink to "NO_AUTO_SHIFT_TAB (simple define)""></a></h3><p>Do not Auto Shift KC_TAB but leave Auto Shift enabled for the other special characters.</p><h3 id="no-auto-shift-symbols-simple-define" tabindex="-1">NO_AUTO_SHIFT_SYMBOLS (simple define) <a class="header-anchor" href="#no-auto-shift-symbols-simple-define" aria-label="Permalink to "NO_AUTO_SHIFT_SYMBOLS (simple define)""></a></h3><p>Do not Auto Shift symbol keys, which include -_, =+, [{, ]}, ;:, '", ,<, .>, and /?.</p><h3 id="no-auto-shift-numeric-simple-define" tabindex="-1">NO_AUTO_SHIFT_NUMERIC (simple define) <a class="header-anchor" href="#no-auto-shift-numeric-simple-define" aria-label="Permalink to "NO_AUTO_SHIFT_NUMERIC (simple define)""></a></h3><p>Do not Auto Shift numeric keys, zero through nine.</p><h3 id="no-auto-shift-alpha-simple-define" tabindex="-1">NO_AUTO_SHIFT_ALPHA (simple define) <a class="header-anchor" href="#no-auto-shift-alpha-simple-define" aria-label="Permalink to "NO_AUTO_SHIFT_ALPHA (simple define)""></a></h3><p>Do not Auto Shift alpha characters, which include A through Z.</p><h3 id="auto-shift-enter-simple-define" tabindex="-1">AUTO_SHIFT_ENTER (simple define) <a class="header-anchor" href="#auto-shift-enter-simple-define" aria-label="Permalink to "AUTO_SHIFT_ENTER (simple define)""></a></h3><p>Auto Shift the enter key.</p><h3 id="auto-shift-per-key" tabindex="-1">Auto Shift Per Key <a class="header-anchor" href="#auto-shift-per-key" aria-label="Permalink to "Auto Shift Per Key""></a></h3><p>There are functions that allows you to determine which keys should be autoshifted, much like the tap-hold keys.</p><p>The first of these, used to simply add a key to Auto Shift, is <code>get_custom_auto_shifted_key</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;">bool</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_custom_auto_shifted_key</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:#24292E;--shiki-dark:#E1E4E8;"> KC_DOT:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> false</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></code></pre></div><p>For more granular control, there is <code>get_auto_shifted_key</code>. The default function looks like this:</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;">bool</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_auto_shifted_key</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;"># ifndef</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> NO_AUTO_SHIFT_ALPHA</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> case AUTO_SHIFT_ALPHA:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># endif</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># ifndef</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> NO_AUTO_SHIFT_NUMERIC</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> case AUTO_SHIFT_NUMERIC:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># endif</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># ifndef</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> NO_AUTO_SHIFT_SPECIAL</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># ifndef</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> NO_AUTO_SHIFT_TAB</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> case KC_TAB:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># endif</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># ifndef</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> NO_AUTO_SHIFT_SYMBOLS</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> case AUTO_SHIFT_SYMBOLS:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># endif</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># endif</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># ifdef</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> AUTO_SHIFT_ENTER</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> case KC_ENT:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"># endif</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</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:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_custom_auto_shifted_key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(keycode, record);</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><p>This functionality is enabled by default, and does not need a define.</p><h3 id="auto-shift-repeat-simple-define" tabindex="-1">AUTO_SHIFT_REPEAT (simple define) <a class="header-anchor" href="#auto-shift-repeat-simple-define" aria-label="Permalink to "AUTO_SHIFT_REPEAT (simple define)""></a></h3><p>Enables keyrepeat.</p><h3 id="auto-shift-no-auto-repeat-simple-define" tabindex="-1">AUTO_SHIFT_NO_AUTO_REPEAT (simple define) <a class="header-anchor" href="#auto-shift-no-auto-repeat-simple-define" aria-label="Permalink to "AUTO_SHIFT_NO_AUTO_REPEAT (simple define)""></a></h3><p>Disables automatically keyrepeating when <code>AUTO_SHIFT_TIMEOUT</code> is exceeded.</p><h3 id="auto-shift-alpha-predefined-key-group" tabindex="-1">AUTO_SHIFT_ALPHA (predefined key group) <a class="header-anchor" href="#auto-shift-alpha-predefined-key-group" aria-label="Permalink to "AUTO_SHIFT_ALPHA (predefined key group)""></a></h3><p>A predefined group of keys representing A through Z.</p><h3 id="auto-shift-numeric-predefined-key-group" tabindex="-1">AUTO_SHIFT_NUMERIC (predefined key group) <a class="header-anchor" href="#auto-shift-numeric-predefined-key-group" aria-label="Permalink to "AUTO_SHIFT_NUMERIC (predefined key group)""></a></h3><p>A predefined group of keys representing 0 through 9. Note, these are defined as 1 through 0 since that is the order they normally appear in.</p><h3 id="auto-shift-symbols-predefined-key-group" tabindex="-1">AUTO_SHIFT_SYMBOLS (predefined key group) <a class="header-anchor" href="#auto-shift-symbols-predefined-key-group" aria-label="Permalink to "AUTO_SHIFT_SYMBOLS (predefined key group)""></a></h3><p>A predefined group of keys representing symbolic characters which include -_, =+, [{, ]}, ;:, '", ,<, .>, and /?.</p><h3 id="auto-shift-special-predefined-key-group" tabindex="-1">AUTO_SHIFT_SPECIAL (predefined key group) <a class="header-anchor" href="#auto-shift-special-predefined-key-group" aria-label="Permalink to "AUTO_SHIFT_SPECIAL (predefined key group)""></a></h3><p>A predefined group of keys that combines AUTO_SHIFT_SYMBOLS and KC_TAB.</p><h2 id="custom-shifted-values" tabindex="-1">Custom Shifted Values <a class="header-anchor" href="#custom-shifted-values" aria-label="Permalink to "Custom Shifted Values""></a></h2><p>Especially on small keyboards, the default shifted value for many keys is not optimal. To provide more customizability, there are two user-definable functions, <code>autoshift_press/release_user</code>. These register or unregister the correct value for the passed key. Below is an example adding period to Auto Shift and making its shifted value exclamation point. Make sure to use weak mods - setting real would make any keys following it use their shifted values as if you were holding the key. Clearing of modifiers is handled by Auto Shift, and the OS-sent shift value if keyrepeating multiple keys is always that of the last key pressed (whether or not it's an Auto Shift key).</p><p>You can also have non-shifted keys for the shifted values (or even no shifted value), just don't set a shift modifier!</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;">bool</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_custom_auto_shifted_key</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:#24292E;--shiki-dark:#E1E4E8;"> KC_DOT:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> false</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>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> autoshift_press_user</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:#D73A49;--shiki-dark:#F97583;">bool</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> shifted</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:#24292E;--shiki-dark:#E1E4E8;"> KC_DOT:</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> register_code16</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">((</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">!</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">shifted) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KC_DOT </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KC_EXLM);</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> break</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (shifted) {</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> add_weak_mods</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">MOD_BIT</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(KC_LSFT));</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // & 0xFF gets the Tap key for Tap Holds, required when using Retro Shift</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> register_code16</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">((</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">IS_RETRO</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(keycode)) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> keycode </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> 0x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">FF</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> :</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> keycode);</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>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">void</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> autoshift_release_user</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:#D73A49;--shiki-dark:#F97583;">bool</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> shifted</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:#24292E;--shiki-dark:#E1E4E8;"> KC_DOT:</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> unregister_code16</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">((</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">!</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">shifted) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KC_DOT </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> KC_EXLM);</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> break</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> default</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // & 0xFF gets the Tap key for Tap Holds, required when using Retro Shift</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // The IS_RETRO check isn't really necessary here, always using</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // keycode & 0xFF would be fine.</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> unregister_code16</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">((</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">IS_RETRO</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(keycode)) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> keycode </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> 0x</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">FF</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> :</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> keycode);</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></code></pre></div><h2 id="retro-shift" tabindex="-1">Retro Shift <a class="header-anchor" href="#retro-shift" aria-label="Permalink to "Retro Shift""></a></h2><p>Holding and releasing a Tap Hold key without pressing another key will ordinarily result in only the hold. With <code>retro shift</code> enabled this action will instead produce a shifted version of the tap keycode on release.</p><p>It does not require <a href="./../tap_hold#retro-tapping">Retro Tapping</a> to be enabled, and if both are enabled the state of <code>retro tapping</code> will only apply if the tap keycode is not matched by Auto Shift. <code>RETRO_TAPPING_PER_KEY</code> and its corresponding function, however, are checked before <code>retro shift</code> is applied.</p><p>To enable <code>retro shift</code>, 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;"> RETRO_SHIFT</span></span></code></pre></div><p>If <code>RETRO_SHIFT</code> is defined to a value, hold times greater than that value will not produce a tap on release for Mod Taps, and instead triggers the hold action. This enables modifiers to be held for combining with mouse clicks without generating taps on release. For example:</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;"> RETRO_SHIFT</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 500</span></span></code></pre></div><p>Without a value set, holds of any length without an interrupting key will produce the shifted value.</p><p>This value (if set) must be greater than one's <code>TAPPING_TERM</code>, as the key press must be designated as a 'hold' by <code>process_tapping</code> before we send the modifier. <a href="./../tap_hold#tapping-term">Per-key tapping terms</a> can be used as a workaround. There is no such limitation in regards to <code>AUTO_SHIFT_TIMEOUT</code> for normal keys.</p><p><strong>Note:</strong> Tap Holds must be added to Auto Shift, see <a href="./auto_shift#auto-shift-per-key">here.</a><code>IS_RETRO</code> may be helpful if one wants all Tap Holds retro shifted.</p><h3 id="retro-shift-and-tap-hold-configurations" tabindex="-1">Retro Shift and Tap Hold Configurations <a class="header-anchor" href="#retro-shift-and-tap-hold-configurations" aria-label="Permalink to "Retro Shift and Tap Hold Configurations""></a></h3><p>Tap Hold Configurations work a little differently when using Retro Shift. Referencing <code>TAPPING_TERM</code> makes little sense, as holding longer would result in shifting one of the keys.</p><p><code>RETRO_SHIFT</code> enables <a href="./../tap_hold#permissive-hold"><code>PERMISSIVE_HOLD</code>-like behaviour</a> (even if not explicitly enabled) on all mod-taps for which <code>RETRO_SHIFT</code> applies.</p><h2 id="using-auto-shift-setup" tabindex="-1">Using Auto Shift Setup <a class="header-anchor" href="#using-auto-shift-setup" aria-label="Permalink to "Using Auto Shift Setup""></a></h2><p>This will enable you to define three keys temporarily to increase, decrease and report your <code>AUTO_SHIFT_TIMEOUT</code>.</p><h3 id="setup" tabindex="-1">Setup <a class="header-anchor" href="#setup" aria-label="Permalink to "Setup""></a></h3><p>Map three keys temporarily in your keymap:</p><table><thead><tr><th>Keycode</th><th>Aliases</th><th>Description</th></tr></thead><tbody><tr><td><code>QK_AUTO_SHIFT_DOWN</code></td><td><code>AS_DOWN</code></td><td>Lower the Auto Shift timeout variable (down)</td></tr><tr><td><code>QK_AUTO_SHIFT_UP</code></td><td><code>AS_UP</code></td><td>Raise the Auto Shift timeout variable (up)</td></tr><tr><td><code>QK_AUTO_SHIFT_REPORT</code></td><td><code>AS_RPT</code></td><td>Report your current Auto Shift timeout value</td></tr><tr><td><code>QK_AUTO_SHIFT_ON</code></td><td><code>AS_ON</code></td><td>Turns on the Auto Shift Function</td></tr><tr><td><code>QK_AUTO_SHIFT_OFF</code></td><td><code>AS_OFF</code></td><td>Turns off the Auto Shift Function</td></tr><tr><td><code>QK_AUTO_SHIFT_TOGGLE</code></td><td><code>AS_TOGG</code></td><td>Toggles the state of the Auto Shift feature</td></tr></tbody></table><p>Compile and upload your new firmware.</p><h3 id="use" tabindex="-1">Use <a class="header-anchor" href="#use" aria-label="Permalink to "Use""></a></h3><p>It is important to note that during these tests, you should be typing completely normal and with no intention of shifted keys.</p><ol><li>Type multiple sentences of alphabetical letters.</li><li>Observe any upper case letters.</li><li>If there are none, press the key you have mapped to <code>AS_DOWN</code> to decrease time Auto Shift timeout value and go back to step 1.</li><li>If there are some upper case letters, decide if you need to work on tapping those keys with less down time, or if you need to increase the timeout.</li><li>If you decide to increase the timeout, press the key you have mapped to <code>AS_UP</code> and go back to step 1.</li><li>Once you are happy with your results, press the key you have mapped to <code>AS_RPT</code>. The keyboard will type by itself the value of your <code>AUTO_SHIFT_TIMEOUT</code>.</li><li>Update <code>AUTO_SHIFT_TIMEOUT</code> in your <code>config.h</code> with the value reported.</li><li>Add <code>AUTO_SHIFT_NO_SETUP</code> to your <code>config.h</code>.</li><li>Remove the key bindings <code>AS_DOWN</code>, <code>AS_UP</code> and <code>AS_RPT</code>.</li><li>Compile and upload your new firmware.</li></ol><h4 id="an-example-run" tabindex="-1">An Example Run <a class="header-anchor" href="#an-example-run" aria-label="Permalink to "An Example Run""></a></h4><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>hello world. my name is john doe. i am a computer programmer playing with</span></span>\n<span class="line"><span>keyboards right now.</span></span>\n<span class="line"><span></span></span>\n<span class="line"><span>[PRESS AS_DOWN quite a few times]</span></span>\n<span class="line"><span></span></span>\n<span class="line"><span>heLLo woRLd. mY nAMe is JOHn dOE. i AM A compUTeR proGRaMMER PlAYiNG witH</span></span>\n<span class="line"><span>KEYboArDS RiGHT NOw.</span></span>\n<span class="line"><span></span></span>\n<span class="line"><span>[PRESS AS_UP a few times]</span></span>\n<span class="line"><span></span></span>\n<span class="line"><span>hello world. my name is john Doe. i am a computer programmer playing with</span></span>\n<span class="line"><span>keyboarDs right now.</span></span>\n<span class="line"><span></span></span>\n<span class="line"><span>[PRESS AS_RPT]</span></span>\n<span class="line"><span></span></span>\n<span class="line"><span>115</span></span></code></pre></div><p>The keyboard typed <code>115</code> which represents your current <code>AUTO_SHIFT_TIMEOUT</code> value. You are now set! Practice on the <em>D</em> key a little bit that showed up in the testing and you'll be golden.</p>', 94);
|
||
const _hoisted_95 = [
|
||
_hoisted_1
|
||
];
|
||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||
return openBlock(), createElementBlock("div", null, _hoisted_95);
|
||
}
|
||
const auto_shift = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||
export {
|
||
__pageData,
|
||
auto_shift as default
|
||
};
|