qmk_firmware/assets/features_space_cadet.md.DmNfYRVJ.js

16 lines
8.6 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
const __pageData = JSON.parse('{"title":"Space Cadet: The Future, Built In","description":"","frontmatter":{},"headers":[],"relativePath":"features/space_cadet.md","filePath":"features/space_cadet.md"}');
const _sfc_main = { name: "features/space_cadet.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="space-cadet-the-future-built-in" tabindex="-1">Space Cadet: The Future, Built In <a class="header-anchor" href="#space-cadet-the-future-built-in" aria-label="Permalink to &quot;Space Cadet: The Future, Built In&quot;"></a></h1><p>Steve Losh described the <a href="https://web.archive.org/web/20230330090938/https://stevelosh.com/blog/2012/10/a-modern-space-cadet/" target="_blank" rel="noreferrer">Space Cadet Shift</a> quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it&#39;s as cool as it sounds, and now even cooler supporting Control and Alt as well!</p><h2 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to &quot;Usage&quot;"></a></h2><p>Firstly, in your keymap, do one of the following:</p><ul><li>Replace the Left Shift key with <code>SC_LSPO</code> (Left Shift, Parenthesis Open), and Right Shift with <code>SC_RSPC</code> (Right Shift, Parenthesis Close).</li><li>Replace the Left Control key with <code>SC_LCPO</code> (Left Control, Parenthesis Open), and Right Control with <code>SC_RCPC</code> (Right Control, Parenthesis Close).</li><li>Replace the Left Alt key with <code>SC_LAPO</code> (Left Alt, Parenthesis Open), and Right Alt with <code>SC_RAPC</code> (Right Alt, Parenthesis Close).</li><li>Replace any Shift key in your keymap with <code>SC_SENT</code> (Right Shift, Enter).</li></ul><h2 id="keycodes" tabindex="-1">Keycodes <a class="header-anchor" href="#keycodes" aria-label="Permalink to &quot;Keycodes&quot;"></a></h2><table><thead><tr><th>Keycode</th><th>Aliases</th><th>Description</th></tr></thead><tbody><tr><td><code>QK_SPACE_CADET_LEFT_CTRL_PARENTHESIS_OPEN</code></td><td><code>SC_LCPO</code></td><td>Left Control when held, <code>(</code> when tapped</td></tr><tr><td><code>QK_SPACE_CADET_RIGHT_CTRL_PARENTHESIS_CLOSE</code></td><td><code>SC_RCPC</code></td><td>Right Control when held, <code>)</code> when tapped</td></tr><tr><td><code>QK_SPACE_CADET_LEFT_SHIFT_PARENTHESIS_OPEN</code></td><td><code>SC_LSPO</code></td><td>Left Shift when held, <code>(</code> when tapped</td></tr><tr><td><code>QK_SPACE_CADET_RIGHT_SHIFT_PARENTHESIS_CLOSE</code></td><td><code>SC_RSPC</code></td><td>Right Shift when held, <code>)</code> when tapped</td></tr><tr><td><code>QK_SPACE_CADET_LEFT_ALT_PARENTHESIS_OPEN</code></td><td><code>SC_LAPO</code></td><td>Left Alt when held, <code>(</code> when tapped</td></tr><tr><td><code>QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE</code></td><td><code>SC_RAPC</code></td><td>Right Alt when held, <code>)</code> when tapped</td></tr><tr><td><code>QK_SPACE_CADET_RIGHT_SHIFT_ENTER</code></td><td><code>SC_SENT</code></td><td>Right Shift when held, Enter when tapped</td></tr></tbody></table><h2 id="caveats" tabindex="-1">Caveats <a class="header-anchor" href="#caveats" aria-label="Permalink to &quot;Caveats&quot;"></a></h2><p>Space Cadet&#39;s functionality can conflict with the default Command functionality when both Shift keys are held at the same time. See the <a href="./command">Command feature</a> for info on how to change it, or make sure that Command is disabled in your <code>rules.mk</code> with:</p><div class="language-make vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">make</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">COMMAND_ENABLE = no</span></span></code></pre></div><h2 id="configuration" tabindex="-1">Configuration <a class="header-anchor" href="#configuration" aria-label="Permalink to &quot;Configuration&quot;"></a></h2><p>By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your <code>config.h</code>. In addition, you can redefine the modifier to send on tap, or even send no modifier at all. The new configuration defines bundle all options up into a single define of 3 key codes in this order: the <code>Modifier</code> when held or when used with other keys, the <code>Tap Modifer</code> sent when tapped (no modifier if <code>KC_TRNS</code>), finally the <code>Keycode</code> sent when tapped. Now keep in mind, mods from other keys will still apply to the <code>Keycode</code> if say <code>KC_RSFT</code> is held while tapping <code>SC_LSPO</code> key with <code>KC_TRNS</code> as the <code>Tap Modifer</code>.</p><table><thead><tr><th>Define</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>LSPO_KEYS</code></td><td><code>KC_LSFT, LSPO_MOD, LSPO_KEY</code></td><td>Send <code>KC_LSFT</code> when held, the mod and key defined by <code>LSPO_MOD</code> and <code>LSPO_KEY</code>.</td></tr><tr><td><code>RSPC_KEYS</code></td><td><code>KC_RSFT, RSPC_MOD, RSPC_KEY</code></td><td>Send <code>KC_RSFT</code> when held, the mod and key defined by <code>RSPC_MOD</code> and <code>RSPC_KEY</code>.</td></tr><tr><td><code>LCPO_KEYS</code></td><td><code>KC_LCTL, KC_LSFT, KC_9</code></td><td>Send <code>KC_LCTL</code> when held, the mod <code>KC_LSFT</code> with the key <code>KC_9</code> when tapped.</td></tr><tr><td><code>RCPC_KEYS</code></td><td><code>KC_RCTL, KC_RSFT, KC_0</code></td><td>Send <code>KC_RCTL</code> when held, the mod <code>KC_RSFT</code> with the key <code>KC_0</code> when tapped.</td></tr><tr><td><code>LAPO_KEYS</code></td><td><code>KC_LALT, KC_LSFT, KC_9</code></td><td>Send <code>KC_LALT</code> when held, the mod <code>KC_LSFT</code> with the key <code>KC_9</code> when tapped.</td></tr><tr><td><code>RAPC_KEYS</code></td><td><code>KC_RALT, KC_RSFT, KC_0</code></td><td>Send <code>KC_RALT</code> when held, the mod <code>KC_RSFT</code> with the key <code>KC_0</code> when tapped.</td></tr><tr><td><code>SFTENT_KEYS</code></td><td><code>KC_RSFT, KC_TRNS, SFTENT_KEY</code></td><td>Send <code>KC_RSFT</code> when held, no mod with the key <code>SFTENT_KEY</code> when tapped.</td></tr><tr><td><code>SPACE_CADET_MODIFIER_CARRYOVER</code></td><td><em>Not defined</em></td><td>Store current modifiers before the hold mod is pressed and use them with the tap mod and keycode. Useful for when you frequently release a modifier before triggering Space Cadet.</td></tr></tbody></table><h2 id="obsolete-configuration" tabindex="-1">Obsolete Configuration <a class="header-anchor" href="#obsolete-configuration" aria-label="Permalink to &quot;Obsolete Configuration&quot;"></a></h2><p>These defines are used in the above defines internally to support backwards compatibility, so you may continue to use them, however the above defines open up a larger range of flexibility than before. As an example, say you want to not send any modifier when you tap just <code>SC_LSPO</code>, with the old defines you had an all or nothing choice of using the <code>DISABLE_SPACE_CADET_MODIFIER</code> define. Now you can define that key as: <code>#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_9</code>. This tells the system to set Left Shift if held or used with other keys, then on tap send no modifier (transparent) with the <code>KC_9</code>.</p><table><thead><tr><th>Define</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>LSPO_KEY</code></td><td><code>KC_9</code></td><td>The keycode to send when Left Shift is tapped</td></tr><tr><td><code>RSPC_KEY</code></td><td><code>KC_0</code></td><td>The keycode to send when Right Shift is tapped</td></tr><tr><td><code>LSPO_MOD</code></td><td><code>KC_LSFT</code></td><td>The modifier to apply to <code>LSPO_KEY</code></td></tr><tr><td><code>RSPC_MOD</code></td><td><code>KC_RSFT</code></td><td>The modifier to apply to <code>RSPC_KEY</code></td></tr><tr><td><code>SFTENT_KEY</code></td><td><code>KC_ENT</code></td><td>The keycode to send when the Shift key is tapped</td></tr><tr><td><code>DISABLE_SPACE_CADET_MODIFIER</code></td><td><em>Not defined</em></td><td>If defined, prevent the Space Cadet from applying a modifier</td></tr></tbody></table>', 16);
const _hoisted_17 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_17);
}
const space_cadet = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
space_cadet as default
};