From c72112c01759bef446502011f04b23e8e2ba8139 Mon Sep 17 00:00:00 2001 From: Thomas Huber <113915837+huber-th@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:41:31 -0700 Subject: [PATCH] feat(keymap): create master header for dt-bindings imports --- app/include/dt-bindings/zmk/params.h | 18 ++++++++++++++++++ docs/docs/keymap-example-file.md | 2 +- docs/docs/keymaps/behaviors/backlight.md | 4 ++++ docs/docs/keymaps/behaviors/bluetooth.md | 4 ++++ docs/docs/keymaps/behaviors/key-press.md | 4 ++-- docs/docs/keymaps/behaviors/mouse-emulation.md | 4 ++++ docs/docs/keymaps/behaviors/outputs.md | 4 ++++ docs/docs/keymaps/behaviors/power.md | 4 ++++ docs/docs/keymaps/behaviors/underglow.md | 4 ++++ docs/docs/keymaps/index.mdx | 2 +- 10 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 app/include/dt-bindings/zmk/params.h diff --git a/app/include/dt-bindings/zmk/params.h b/app/include/dt-bindings/zmk/params.h new file mode 100644 index 00000000..91a33240 --- /dev/null +++ b/app/include/dt-bindings/zmk/params.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include "backlight.h" +#include "bt.h" +#include "ext_power.h" +#include "hid_usage.h" +#include "hid_usage_pages.h" +#include "keys.h" +#include "matrix_transform.h" +#include "modifiers.h" +#include "mouse.h" +#include "outputs.h" +#include "reset.h" +#include "rgb.h" diff --git a/docs/docs/keymap-example-file.md b/docs/docs/keymap-example-file.md index 91213f15..092d7f7f 100644 --- a/docs/docs/keymap-example-file.md +++ b/docs/docs/keymap-example-file.md @@ -1,6 +1,6 @@ ```dts #include -#include +#include / { keymap { diff --git a/docs/docs/keymaps/behaviors/backlight.md b/docs/docs/keymaps/behaviors/backlight.md index 88445dc9..2f2d2802 100644 --- a/docs/docs/keymaps/behaviors/backlight.md +++ b/docs/docs/keymaps/behaviors/backlight.md @@ -9,6 +9,10 @@ This page contains [backlight](../../features/backlight.mdx) behaviors supported ## Backlight Action Defines +:::info +No longer required as long as your keymap includes [`dt-bindings/zmk/params.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/all.h). +::: + Backlight actions defines are provided through the [`dt-bindings/zmk/backlight.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/backlight.h) header, which is added at the top of the keymap file: diff --git a/docs/docs/keymaps/behaviors/bluetooth.md b/docs/docs/keymaps/behaviors/bluetooth.md index 93d08428..7f872e78 100644 --- a/docs/docs/keymaps/behaviors/bluetooth.md +++ b/docs/docs/keymaps/behaviors/bluetooth.md @@ -27,6 +27,10 @@ even if OUT_USB is selected. To remain disconnected, another bluetooth profile m ## Bluetooth Command Defines +:::info +No longer required as long as your keymap includes [`dt-bindings/zmk/params.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/all.h). +::: + Bluetooth command defines are provided through the [`dt-bindings/zmk/bt.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/bt.h) header, which is added at the top of the keymap file: diff --git a/docs/docs/keymaps/behaviors/key-press.md b/docs/docs/keymaps/behaviors/key-press.md index f60c1776..93c4e1fc 100644 --- a/docs/docs/keymaps/behaviors/key-press.md +++ b/docs/docs/keymaps/behaviors/key-press.md @@ -24,11 +24,11 @@ For advanced users, user-defined HID usages are also supported but must be encod ## Keycode Defines To make it easier to encode the HID keycode numeric values, most keymaps include -the [`dt-bindings/zmk/keys.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/keys.h) header +the [`dt-bindings/zmk/params.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/all.h) header provided by ZMK near the top: ```dts -#include +#include ``` Doing so makes a set of defines such as `A`, `N1`, etc. available for use with these behaviors diff --git a/docs/docs/keymaps/behaviors/mouse-emulation.md b/docs/docs/keymaps/behaviors/mouse-emulation.md index 26bef8cc..43fc3e24 100644 --- a/docs/docs/keymaps/behaviors/mouse-emulation.md +++ b/docs/docs/keymaps/behaviors/mouse-emulation.md @@ -27,6 +27,10 @@ If you use the mouse key press behavior in your keymap, the feature will automat ## Mouse Button Defines +:::info +No longer required as long as your keymap includes [`dt-bindings/zmk/params.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/all.h). +::: + To make it easier to encode the HID mouse button numeric values, include the [`dt-bindings/zmk/mouse.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/mouse.h) header provided by ZMK near the top: diff --git a/docs/docs/keymaps/behaviors/outputs.md b/docs/docs/keymaps/behaviors/outputs.md index 20ce8a69..6df50411 100644 --- a/docs/docs/keymaps/behaviors/outputs.md +++ b/docs/docs/keymaps/behaviors/outputs.md @@ -20,6 +20,10 @@ to select the BLE output through below behavior to be able to send keystrokes to ## Output Command Defines +:::info +No longer required as long as your keymap includes [`dt-bindings/zmk/params.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/all.h). +::: + Output command defines are provided through the [`dt-bindings/zmk/outputs.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/outputs.h) header, which is added at the top of the keymap file: diff --git a/docs/docs/keymaps/behaviors/power.md b/docs/docs/keymaps/behaviors/power.md index 4c333080..fe1e44f5 100644 --- a/docs/docs/keymaps/behaviors/power.md +++ b/docs/docs/keymaps/behaviors/power.md @@ -21,6 +21,10 @@ The following boards currently support this feature: ## External Power Control Command Defines +:::info +No longer required as long as your keymap includes [`dt-bindings/zmk/params.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/all.h). +::: + External power control command defines are provided through the [`dt-bindings/zmk/ext_power.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/ext_power.h) header, which is added at the top of the keymap file: diff --git a/docs/docs/keymaps/behaviors/underglow.md b/docs/docs/keymaps/behaviors/underglow.md index 5fda9a1d..f20b6455 100644 --- a/docs/docs/keymaps/behaviors/underglow.md +++ b/docs/docs/keymaps/behaviors/underglow.md @@ -9,6 +9,10 @@ This page contains [RGB Underglow](../../features/underglow.md) behaviors suppor ## RGB Action Defines +:::info +No longer required as long as your keymap includes [`dt-bindings/zmk/params.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/all.h). +::: + RGB actions defines are provided through the [`dt-bindings/zmk/rgb.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/rgb.h) header, which is added at the top of the keymap file: diff --git a/docs/docs/keymaps/index.mdx b/docs/docs/keymaps/index.mdx index 2d3e204f..18d7076d 100644 --- a/docs/docs/keymaps/index.mdx +++ b/docs/docs/keymaps/index.mdx @@ -91,7 +91,7 @@ The top two lines of most keymaps should include: ```dts #include -#include +#include ``` The first defines the nodes for all the available behaviors in ZMK, which will be referenced in the behavior bindings. This is how bindings like `&kp` can reference the key press behavior defined with an anchor name of `kp`.