mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-02-27 01:56:43 +00:00
16 lines
27 KiB
JavaScript
16 lines
27 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":"Backlighting","description":"","frontmatter":{},"headers":[],"relativePath":"features/backlight.md","filePath":"features/backlight.md"}');
|
|||
|
const _sfc_main = { name: "features/backlight.md" };
|
|||
|
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="backlighting" tabindex="-1">Backlighting <a class="header-anchor" href="#backlighting" aria-label="Permalink to "Backlighting {#backlighting}""></a></h1><p>Many keyboards support backlit keys by way of individual LEDs placed through or underneath the keyswitches. This feature is distinct from both the <a href="./rgblight">RGB Underglow</a> and <a href="./rgb_matrix">RGB Matrix</a> features as it usually allows for only a single colour per switch, though you can obviously install multiple different single coloured LEDs on a keyboard.</p><p>QMK is able to control the brightness of these LEDs by switching them on and off rapidly in a certain ratio, a technique known as <em>Pulse Width Modulation</em>, or PWM. By altering the duty cycle of the PWM signal, it creates the illusion of dimming.</p><h2 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to "Usage {#usage}""></a></h2><p>Most keyboards have backlighting enabled by default if they support it, but if it is not working for you (or you have added support), check that your <code>rules.mk</code> includes the following:</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;">BACKLIGHT_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_BACKLIGHT_TOGGLE</code></td><td><code>BL_TOGG</code></td><td>Turn the backlight on or off</td></tr><tr><td><code>QK_BACKLIGHT_STEP</code></td><td><code>BL_STEP</code></td><td>Cycle through backlight levels</td></tr><tr><td><code>QK_BACKLIGHT_ON</code></td><td><code>BL_ON</code></td><td>Set the backlight to max brightness</td></tr><tr><td><code>QK_BACKLIGHT_OFF</code></td><td><code>BL_OFF</code></td><td>Turn the backlight off</td></tr><tr><td><code>QK_BACKLIGHT_UP</code></td><td><code>BL_UP</code></td><td>Increase the backlight level</td></tr><tr><td><code>QK_BACKLIGHT_DOWN</code></td><td><code>BL_DOWN</code></td><td>Decrease the backlight level</td></tr><tr><td><code>QK_BACKLIGHT_TOGGLE_BREATHING</code></td><td><code>BL_BRTG</code></td><td>Toggle backlight breathing</td></tr></tbody></table><h2 id="basic-configuration" tabindex="-1">Basic Configuration <a class="header-anchor" href="#basic-configuration" aria-label="Permalink to "Basic Configuration {#basic-configuration}""></a></h2><p>Add the following to your <code>config.h</code>:</p><table><thead><tr><th>Define</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>BACKLIGHT_PIN</code></td><td><em>Not defined</em></td><td>The pin that controls the LEDs</td></tr><tr><td><code>BACKLIGHT_LEVELS</code></td><td><code>3</code></td><td>The number of brightness levels (maximum 31 excluding off)</td></tr><tr><td><code>BACKLIGHT_CAPS_LOCK</code></td><td><em>Not defined</em></td><td>Enable Caps Lock indicator using backlight (for keyboards without dedicated LED)</td></tr><tr><td><code>BACKLIGHT_BREATHING</code></td><td><em>Not defined</em></td><td>Enable backlight breathing, if supported</td></tr><tr><td><code>BREATHING_PERIOD</code></td><td><code>6</code></td><td>The length of one backlight "breath" in seconds</td></tr><tr><td><code>BACKLIGHT_ON_STATE</code></td><td><code>1</code></td><td>The state of the backlight pin when the backlight is "on" - <code>1</code> for high, <code>0</code> for low</td></tr><tr><td><code>BACKLIGHT_LIMIT_VAL</code></td><td><code>255</code></td><td>The maximum duty cycle of the backlight -- <code>255</code> allows for full brightness, any lower will decrease the maximum.</td></tr><tr><td><code>BACKLIGHT_DEFAULT_ON</code></td><td><co
|
|||
|
const _hoisted_116 = [
|
|||
|
_hoisted_1
|
|||
|
];
|
|||
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|||
|
return openBlock(), createElementBlock("div", null, _hoisted_116);
|
|||
|
}
|
|||
|
const backlight = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|||
|
export {
|
|||
|
__pageData,
|
|||
|
backlight as default
|
|||
|
};
|