mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-02-27 01:56:43 +00:00
16 lines
12 KiB
JavaScript
16 lines
12 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":"Programmable Button","description":"","frontmatter":{},"headers":[],"relativePath":"features/programmable_button.md","filePath":"features/programmable_button.md"}');
|
||
const _sfc_main = { name: "features/programmable_button.md" };
|
||
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="programmable-button" tabindex="-1">Programmable Button <a class="header-anchor" href="#programmable-button" aria-label="Permalink to "Programmable Button {#programmable-button}""></a></h1><p>Programmable Buttons are keys that have no predefined meaning. This means they can be processed on the host side by custom software without the operating system trying to interpret them.</p><p>The keycodes are emitted according to the HID Telephony Device page (<code>0x0B</code>), Programmable Button usage (<code>0x09</code>). On Linux (> 5.14) they are handled automatically and translated to <code>KEY_MACRO#</code> keycodes (up to <code>KEY_MACRO30</code>).</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>Currently there is no known support in Windows or macOS. It may be possible to write a custom HID driver to receive these usages, but this is out of the scope of the QMK documentation.</p></div><h2 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to "Usage {#usage}""></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;">PROGRAMMABLE_BUTTON_ENABLE = yes</span></span></code></pre></div><h2 id="keycodes" tabindex="-1">Keycodes <a class="header-anchor" href="#keycodes" aria-label="Permalink to "Keycodes {#keycodes}""></a></h2><table><thead><tr><th>Key</th><th>Aliases</th><th>Description</th></tr></thead><tbody><tr><td><code>QK_PROGRAMMABLE_BUTTON_1</code></td><td><code>PB_1</code></td><td>Programmable button 1</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_2</code></td><td><code>PB_2</code></td><td>Programmable button 2</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_3</code></td><td><code>PB_3</code></td><td>Programmable button 3</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_4</code></td><td><code>PB_4</code></td><td>Programmable button 4</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_5</code></td><td><code>PB_5</code></td><td>Programmable button 5</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_6</code></td><td><code>PB_6</code></td><td>Programmable button 6</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_7</code></td><td><code>PB_7</code></td><td>Programmable button 7</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_8</code></td><td><code>PB_8</code></td><td>Programmable button 8</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_9</code></td><td><code>PB_9</code></td><td>Programmable button 9</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_10</code></td><td><code>PB_10</code></td><td>Programmable button 10</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_11</code></td><td><code>PB_11</code></td><td>Programmable button 11</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_12</code></td><td><code>PB_12</code></td><td>Programmable button 12</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_13</code></td><td><code>PB_13</code></td><td>Programmable button 13</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_14</code></td><td><code>PB_14</code></td><td>Programmable button 14</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_15</code></td><td><code>PB_15</code></td><td>Programmable button 15</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_16</code></td><td><code>PB_16</code></td><td>Programmable button 16</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_17</code></td><td><code>PB_17</code></td><td>Programmable button 17</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_18</code></td><td><code>PB_18</code></td><td>Programmable button 18</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_19</code></td><td><code>PB_19</code></td><td>Programmable button 19</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_20</code></td><td><code>PB_20</code></td><td>Programmable button 20</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_21</code></td><td><code>PB_21</code></td><td>Programmable button 21</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_22</code></td><td><code>PB_22</code></td><td>Programmable button 22</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_23</code></td><td><code>PB_23</code></td><td>Programmable button 23</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_24</code></td><td><code>PB_24</code></td><td>Programmable button 24</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_25</code></td><td><code>PB_25</code></td><td>Programmable button 25</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_26</code></td><td><code>PB_26</code></td><td>Programmable button 26</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_27</code></td><td><code>PB_27</code></td><td>Programmable button 27</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_28</code></td><td><code>PB_28</code></td><td>Programmable button 28</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_29</code></td><td><code>PB_29</code></td><td>Programmable button 29</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_30</code></td><td><code>PB_30</code></td><td>Programmable button 30</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_31</code></td><td><code>PB_31</code></td><td>Programmable button 31</td></tr><tr><td><code>QK_PROGRAMMABLE_BUTTON_32</code></td><td><code>PB_32</code></td><td>Programmable button 32</td></tr></tbody></table><h2 id="api" tabindex="-1">API <a class="header-anchor" href="#api" aria-label="Permalink to "API {#api}""></a></h2><h3 id="api-programmable-button-clear" tabindex="-1"><code>void programmable_button_clear(void)</code> <a class="header-anchor" href="#api-programmable-button-clear" aria-label="Permalink to "`void programmable_button_clear(void)` {#api-programmable-button-clear}""></a></h3><p>Clear the programmable button report.</p><hr><h3 id="api-programmable-button-add" tabindex="-1"><code>void programmable_button_add(uint8_t index)</code> <a class="header-anchor" href="#api-programmable-button-add" aria-label="Permalink to "`void programmable_button_add(uint8_t index)` {#api-programmable-button-add}""></a></h3><p>Set the state of a button.</p><h4 id="api-programmable-button-add-arguments" tabindex="-1">Arguments <a class="header-anchor" href="#api-programmable-button-add-arguments" aria-label="Permalink to "Arguments {#api-programmable-button-add-arguments}""></a></h4><ul><li><code>uint8_t index</code><br> The index of the button to press, from 0 to 31.</li></ul><hr><h3 id="api-programmable-button-remove" tabindex="-1"><code>void programmable_button_remove(uint8_t index)</code> <a class="header-anchor" href="#api-programmable-button-remove" aria-label="Permalink to "`void programmable_button_remove(uint8_t index)` {#api-programmable-button-remove}""></a></h3><p>Reset the state of a button.</p><h4 id="api-programmable-button-remove-arguments" tabindex="-1">Arguments <a class="header-anchor" href="#api-programmable-button-remove-arguments" aria-label="Permalink to "Arguments {#api-programmable-button-remove-arguments}""></a></h4><ul><li><code>uint8_t index</code><br> The index of the button to release, from 0 to 31.</li></ul><hr><h3 id="api-programmable-button-register" tabindex="-1"><code>void programmable_button_register(uint8_t index)</code> <a class="header-anchor" href="#api-programmable-button-register" aria-label="Permalink to "`void programmable_button_register(uint8_t index)` {#api-programmable-button-register}""></a></h3><p>Set the state of a button, and flush the report.</p><h4 id="api-programmable-button-register-arguments" tabindex="-1">Arguments <a class="header-anchor" href="#api-programmable-button-register-arguments" aria-label="Permalink to "Arguments {#api-programmable-button-register-arguments}""></a></h4><ul><li><code>uint8_t index</code><br> The index of the button to press, from 0 to 31.</li></ul><hr><h3 id="api-programmable-button-unregister" tabindex="-1"><code>void programmable_button_unregister(uint8_t index)</code> <a class="header-anchor" href="#api-programmable-button-unregister" aria-label="Permalink to "`void programmable_button_unregister(uint8_t index)` {#api-programmable-button-unregister}""></a></h3><p>Reset the state of a button, and flush the report.</p><h4 id="api-programmable-button-unregister-arguments" tabindex="-1">Arguments <a class="header-anchor" href="#api-programmable-button-unregister-arguments" aria-label="Permalink to "Arguments {#api-programmable-button-unregister-arguments}""></a></h4><ul><li><code>uint8_t index</code><br> The index of the button to release, from 0 to 31.</li></ul><hr><h3 id="api-programmable-button-is-on" tabindex="-1"><code>bool programmable_button_is_on(uint8_t index)</code> <a class="header-anchor" href="#api-programmable-button-is-on" aria-label="Permalink to "`bool programmable_button_is_on(uint8_t index)` {#api-programmable-button-is-on}""></a></h3><p>Get the state of a button.</p><h4 id="api-programmable-button-is-on-arguments" tabindex="-1">Arguments <a class="header-anchor" href="#api-programmable-button-is-on-arguments" aria-label="Permalink to "Arguments {#api-programmable-button-is-on-arguments}""></a></h4><ul><li><code>uint8_t index</code><br> The index of the button to check, from 0 to 31.</li></ul><h4 id="api-programmable-button-is-on-return" tabindex="-1">Return Value <a class="header-anchor" href="#api-programmable-button-is-on-return" aria-label="Permalink to "Return Value {#api-programmable-button-is-on-return}""></a></h4><p><code>true</code> if the button is pressed.</p><hr><h3 id="api-programmable-button-flush" tabindex="-1"><code>void programmable_button_flush(void)</code> <a class="header-anchor" href="#api-programmable-button-flush" aria-label="Permalink to "`void programmable_button_flush(void)` {#api-programmable-button-flush}""></a></h3><p>Send the programmable button report to the host.</p><hr><h3 id="api-programmable-button-get-report" tabindex="-1"><code>uint32_t programmable_button_get_report(void)</code> <a class="header-anchor" href="#api-programmable-button-get-report" aria-label="Permalink to "`uint32_t programmable_button_get_report(void)` {#api-programmable-button-get-report}""></a></h3><p>Get the programmable button report.</p><h4 id="api-programmable-button-get-report-return" tabindex="-1">Return Value <a class="header-anchor" href="#api-programmable-button-get-report-return" aria-label="Permalink to "Return Value {#api-programmable-button-get-report-return}""></a></h4><p>The bitmask of programmable button states.</p><hr><h3 id="api-programmable-button-set-report" tabindex="-1"><code>void programmable_button_set_report(uint32_t report)</code> <a class="header-anchor" href="#api-programmable-button-set-report" aria-label="Permalink to "`void programmable_button_set_report(uint32_t report)` {#api-programmable-button-set-report}""></a></h3><p>Set the programmable button report.</p><h4 id="api-programmable-button-set-report-arguments" tabindex="-1">Arguments <a class="header-anchor" href="#api-programmable-button-set-report-arguments" aria-label="Permalink to "Arguments {#api-programmable-button-set-report-arguments}""></a></h4><ul><li><code>uint32_t report</code><br> A bitmask of programmable button states.</li></ul>', 52);
|
||
const _hoisted_53 = [
|
||
_hoisted_1
|
||
];
|
||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||
return openBlock(), createElementBlock("div", null, _hoisted_53);
|
||
}
|
||
const programmable_button = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||
export {
|
||
__pageData,
|
||
programmable_button as default
|
||
};
|