Files
zmk/app/include/dt-bindings/zmk/hid_indicators.h
Joel Spadin 197f899777 feat: Add LED indicator support (#3239)
This adds a new zmk,indicator-leds device, which maps HID indicator
states onto any devices that implement the LED driver API. This adds
support for things like a caps lock LED.

The name was chosen so that more drivers could be added later as
zmk,indicator-*, for example a version that uses the LED strip API.
2026-03-23 02:35:35 -04:00

19 lines
726 B
C

/*
* Copyright (c) 2026 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#include <dt-bindings/zmk/hid_usage.h>
// hid.h defines HID_USAGE_LED_NUM_LOCK as the minimum value, so that is bit
// zero in the report, and all other indicators are relative to that.
#define HID_INDICATOR_NUM_LOCK (1 << (HID_USAGE_LED_NUM_LOCK - HID_USAGE_LED_NUM_LOCK))
#define HID_INDICATOR_CAPS_LOCK (1 << (HID_USAGE_LED_CAPS_LOCK - HID_USAGE_LED_NUM_LOCK))
#define HID_INDICATOR_SCROLL_LOCK (1 << (HID_USAGE_LED_SCROLL_LOCK - HID_USAGE_LED_NUM_LOCK))
#define HID_INDICATOR_COMPOSE (1 << (HID_USAGE_LED_COMPOSE - HID_USAGE_LED_NUM_LOCK))
#define HID_INDICATOR_KANA (1 << (HID_USAGE_LED_KANA - HID_USAGE_LED_NUM_LOCK))