underglow-layer: use behaviors to control RGBs
This commit is contained in:
parent
aa151f7473
commit
f178f86a54
20 changed files with 352 additions and 26 deletions
|
|
@ -28,3 +28,5 @@
|
|||
#include <behaviors/soft_off.dtsi>
|
||||
#include <behaviors/studio_unlock.dtsi>
|
||||
#include <behaviors/mouse_keys.dtsi>
|
||||
#include <behaviors/ug_color.dtsi>
|
||||
#include <behaviors/ug_indicators.dtsi>
|
||||
|
|
|
|||
15
app/dts/behaviors/ug_color.dtsi
Normal file
15
app/dts/behaviors/ug_color.dtsi
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/*
|
||||
* Copyright (c) 2024 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/ {
|
||||
behaviors {
|
||||
ug: ugcolor {
|
||||
compatible = "zmk,behavior-underglow-color";
|
||||
#binding-cells = <1>;
|
||||
display-name = "Underglow Color";
|
||||
};
|
||||
};
|
||||
};
|
||||
33
app/dts/behaviors/ug_indicators.dtsi
Normal file
33
app/dts/behaviors/ug_indicators.dtsi
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (c) 2024 The ZMK Contributors
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <dt-bindings/zmk/hid_indicators.h>
|
||||
|
||||
/ {
|
||||
behaviors {
|
||||
ug_nl: ugnumlk {
|
||||
compatible = "zmk,behavior-underglow-indicators";
|
||||
indicator = <NUM_LOCK>;
|
||||
#binding-cells = <2>;
|
||||
display-name = "Underglow NumLock indicator";
|
||||
};
|
||||
|
||||
ug_cl: ugcapslk {
|
||||
compatible = "zmk,behavior-underglow-indicators";
|
||||
indicator = <CAPS_LOCK>;
|
||||
#binding-cells = <2>;
|
||||
display-name = "Underglow CapsLock indicator";
|
||||
};
|
||||
|
||||
ug_sl: ugscrllk {
|
||||
compatible = "zmk,behavior-underglow-indicators";
|
||||
indicator = <SCROLL_LOCK>;
|
||||
#binding-cells = <2>;
|
||||
display-name = "Underglow ScrollLock indicator";
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# Copyright (c) 2024, The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
description: Set underglow to specified color
|
||||
|
||||
compatible: "zmk,behavior-underglow-color"
|
||||
|
||||
include: one_param.yaml
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# Copyright (c) 2024, The ZMK Contributors
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
description: Set underglow for num lock indicator
|
||||
|
||||
compatible: "zmk,behavior-underglow-indicators"
|
||||
|
||||
include: two_param.yaml
|
||||
|
||||
properties:
|
||||
indicator:
|
||||
type: int
|
||||
default: 0
|
||||
|
|
@ -3,12 +3,17 @@ description: |
|
|||
|
||||
compatible: "zmk,underglow-layer"
|
||||
|
||||
properties:
|
||||
pixel-lookup:
|
||||
type: array
|
||||
required: true
|
||||
|
||||
child-binding:
|
||||
description: "A layer to be used in a rgbmap"
|
||||
|
||||
properties:
|
||||
bindings:
|
||||
type: array
|
||||
type: phandle-array
|
||||
required: true
|
||||
layer-id:
|
||||
type: int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue