mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-02-27 01:56:43 +00:00
16 lines
25 KiB
JavaScript
16 lines
25 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":"Modifier Keys","description":"","frontmatter":{},"headers":[],"relativePath":"feature_advanced_keycodes.md","filePath":"feature_advanced_keycodes.md"}');
|
|||
|
const _sfc_main = { name: "feature_advanced_keycodes.md" };
|
|||
|
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="modifier-keys" tabindex="-1">Modifier Keys <a class="header-anchor" href="#modifier-keys" aria-label="Permalink to "Modifier Keys {#modifier-keys}""></a></h1><p>These allow you to combine a modifier with a keycode. When pressed, the keydown event for the modifier, then <code>kc</code> will be sent. On release, the keyup event for <code>kc</code>, then the modifier will be sent.</p><table><thead><tr><th>Key</th><th>Aliases</th><th>Description</th></tr></thead><tbody><tr><td><code>LCTL(kc)</code></td><td><code>C(kc)</code></td><td>Hold Left Control and press <code>kc</code></td></tr><tr><td><code>LSFT(kc)</code></td><td><code>S(kc)</code></td><td>Hold Left Shift and press <code>kc</code></td></tr><tr><td><code>LALT(kc)</code></td><td><code>A(kc)</code>, <code>LOPT(kc)</code></td><td>Hold Left Alt and press <code>kc</code></td></tr><tr><td><code>LGUI(kc)</code></td><td><code>G(kc)</code>, <code>LCMD(kc)</code>, <code>LWIN(kc)</code></td><td>Hold Left GUI and press <code>kc</code></td></tr><tr><td><code>RCTL(kc)</code></td><td></td><td>Hold Right Control and press <code>kc</code></td></tr><tr><td><code>RSFT(kc)</code></td><td></td><td>Hold Right Shift and press <code>kc</code></td></tr><tr><td><code>RALT(kc)</code></td><td><code>ROPT(kc)</code>, <code>ALGR(kc)</code></td><td>Hold Right Alt and press <code>kc</code></td></tr><tr><td><code>RGUI(kc)</code></td><td><code>RCMD(kc)</code>, <code>LWIN(kc)</code></td><td>Hold Right GUI and press <code>kc</code></td></tr><tr><td><code>LSG(kc)</code></td><td><code>SGUI(kc)</code>, <code>SCMD(kc)</code>, <code>SWIN(kc)</code></td><td>Hold Left Shift and GUI and press <code>kc</code></td></tr><tr><td><code>LAG(kc)</code></td><td></td><td>Hold Left Alt and Left GUI and press <code>kc</code></td></tr><tr><td><code>RSG(kc)</code></td><td></td><td>Hold Right Shift and Right GUI and press <code>kc</code></td></tr><tr><td><code>RAG(kc)</code></td><td></td><td>Hold Right Alt and Right GUI and press <code>kc</code></td></tr><tr><td><code>LCA(kc)</code></td><td></td><td>Hold Left Control and Alt and press <code>kc</code></td></tr><tr><td><code>LSA(kc)</code></td><td></td><td>Hold Left Shift and Left Alt and press <code>kc</code></td></tr><tr><td><code>RSA(kc)</code></td><td><code>SAGR(kc)</code></td><td>Hold Right Shift and Right Alt (AltGr) and press <code>kc</code></td></tr><tr><td><code>RCS(kc)</code></td><td></td><td>Hold Right Control and Right Shift and press <code>kc</code></td></tr><tr><td><code>LCAG(kc)</code></td><td></td><td>Hold Left Control, Alt and GUI and press <code>kc</code></td></tr><tr><td><code>MEH(kc)</code></td><td></td><td>Hold Left Control, Shift and Alt and press <code>kc</code></td></tr><tr><td><code>HYPR(kc)</code></td><td></td><td>Hold Left Control, Shift, Alt and GUI and press <code>kc</code></td></tr></tbody></table><p>You can also chain them, for example <code>LCTL(LALT(KC_DEL))</code> or <code>C(A(KC_DEL))</code> makes a key that sends Control+Alt+Delete with a single keypress.</p><h1 id="checking-modifier-state" tabindex="-1">Checking Modifier State <a class="header-anchor" href="#checking-modifier-state" aria-label="Permalink to "Checking Modifier State {#checking-modifier-state}""></a></h1><p>The current modifier state can mainly be accessed with two functions: <code>get_mods()</code> for normal modifiers and modtaps and <code>get_oneshot_mods()</code> for one-shot modifiers (unless they're held, in which case they act like normal modifier keys).</p><p>The presence of one or more specific modifiers in the current modifier state can be detected by ANDing the modifier state with a mod mask corresponding to the set of modifiers you want to match for. The reason why bitwise operators are used is that the modifier state is stored as a single byte in the format (GASC)<sub>R</sub>(GASC)<sub>L</sub>.</p><p>Thus, to give an example, <code>01000010</code> would be the internal representation of LShift+RAlt. For more information on bitwise operators in C, click <a href="https://en
|
|||
|
const _hoisted_40 = [
|
|||
|
_hoisted_1
|
|||
|
];
|
|||
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
|
return openBlock(), createElementBlock("div", null, _hoisted_40);
|
|||
|
}
|
|||
|
const feature_advanced_keycodes = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|||
|
export {
|
|||
|
__pageData,
|
|||
|
feature_advanced_keycodes as default
|
|||
|
};
|