qmk_firmware/assets/features_secure.md.BX7jFvW5.js

16 lines
5.0 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":"Secure","description":"","frontmatter":{},"headers":[],"relativePath":"features/secure.md","filePath":"features/secure.md"}');
const _sfc_main = { name: "features/secure.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="secure" tabindex="-1">Secure <a class="header-anchor" href="#secure" aria-label="Permalink to &quot;Secure&quot;"></a></h1><p>The secure feature aims to prevent unwanted interaction without user intervention.</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>Secure does <strong>not</strong> currently implement encryption/decryption/etc and should not be a replacement where a strong hardware/software based solution is required.</p></div><h3 id="unlock-sequence" tabindex="-1">Unlock sequence <a class="header-anchor" href="#unlock-sequence" aria-label="Permalink to &quot;Unlock sequence&quot;"></a></h3><p>To unlock, the user must perform a set of actions. This can optionally be configured to be multiple keys.</p><ul><li>While unlocking all keyboard input is ignored</li><li>Incorrect attempts will revert back to the previously locked state</li></ul><h3 id="automatic-locking" tabindex="-1">Automatic Locking <a class="header-anchor" href="#automatic-locking" aria-label="Permalink to &quot;Automatic Locking&quot;"></a></h3><p>Once unlocked, the keyboard will revert back to a locked state after the configured timeout. The timeout can be refreshed by using the <code>secure_activity_event</code> function, for example from one of the various <a href="./../custom_quantum_functions">hooks</a>.</p><h2 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to &quot;Usage&quot;"></a></h2><p>Add the following to your <code>rules.mk</code>:</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;">SECURE_ENABLE = yes</span></span></code></pre></div><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>Key</th><th>Aliases</th><th>Description</th></tr></thead><tbody><tr><td><code>QK_SECURE_LOCK</code></td><td><code>SE_LOCK</code></td><td>Revert back to a locked state</td></tr><tr><td><code>QK_SECURE_UNLOCK</code></td><td><code>SE_UNLK</code></td><td>Forces unlock without performing a unlock sequence</td></tr><tr><td><code>QK_SECURE_TOGGLE</code></td><td><code>SE_TOGG</code></td><td>Toggle directly between locked and unlock without performing a unlock sequence</td></tr><tr><td><code>QK_SECURE_REQUEST</code></td><td><code>SE_REQ</code></td><td>Request that user perform the unlock sequence</td></tr></tbody></table><h2 id="configuration" tabindex="-1">Configuration <a class="header-anchor" href="#configuration" aria-label="Permalink to &quot;Configuration&quot;"></a></h2><table><thead><tr><th>Define</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>SECURE_UNLOCK_TIMEOUT</code></td><td><code>5000</code></td><td>Timeout for the user to perform the configured unlock sequence - <code>0</code> to disable</td></tr><tr><td><code>SECURE_IDLE_TIMEOUT</code></td><td><code>60000</code></td><td>Timeout while unlocked before returning to locked - <code>0</code> to disable</td></tr><tr><td><code>SECURE_UNLOCK_SEQUENCE</code></td><td><code>{ { 0, 0 } }</code></td><td>Array of matrix locations describing a sequential sequence of keypresses</td></tr></tbody></table><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to &quot;Functions&quot;"></a></h2><table><thead><tr><th>Function</th><th>Description</th></tr></thead><tbody><tr><td><code>secure_is_locked()</code></td><td>Check if the device is currently locked</td></tr><tr><td><code>secure_is_unlocking()</code></td><td>Check if an unlock sequence is currently in progress</td></tr><tr><td><code>secure_is_unlocked()</code></td><td>Check if the device is currently unlocked</td></tr><tr><td><code>secure_lock()</code></td><td>Lock down the device</td></tr><tr><td><code>secure_unlock()</code></td><td>Force unlock the device - bypasses user unlock sequence</td></tr><tr><td><code>secure_request_unlock()</code></td><td>Begin listening for an unlock sequence</td></tr><tr><td><code>secure_activity_event()</code></td><td>Flag that user activity has happened and the device should remain unlocked</td></tr></tbody></table>', 17);
const _hoisted_18 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_18);
}
const secure = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
secure as default
};