zmk/app/dts/behaviors/capslock.dtsi
2023-11-28 20:25:54 +04:00

84 lines
No EOL
2.1 KiB
Text

/*
* Copyright (c) 2023 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/keys.h>
/ {
behaviors {
/omit-if-no-ref/ capslock_on: behavior_capslock_on {
compatible = "zmk,behavior-capslock";
label = "CAPSLOCK_ON";
#binding-cells = <0>;
capslock-press-duration = <5>;
enable-on-press;
};
/omit-if-no-ref/ capslock_off: behavior_capslock_off {
compatible = "zmk,behavior-capslock";
label = "CAPSLOCK_OFF";
#binding-cells = <0>;
capslock-press-duration = <5>;
disable-on-release;
};
/omit-if-no-ref/ capslock_hold: behavior_capslock_hold {
compatible = "zmk,behavior-capslock";
label = "CAPSLOCK_HOLD";
#binding-cells = <0>;
capslock-press-duration = <5>;
enable-on-press;
disable-on-release;
};
/omit-if-no-ref/ capslock_word: behavior_capslock_word {
compatible = "zmk,behavior-capslock";
label = "CAPSLOCK_WORD";
#binding-cells = <0>;
capslock-press-duration = <5>;
enable-on-press;
disable-on-next-release;
disable-on-keys = <SPACE TAB ENTER ESC>;
};
/* MacOS compatibility */
/omit-if-no-ref/ capslock_on_mac: behavior_capslock_on_mac {
compatible = "zmk,behavior-capslock";
label = "CAPSLOCK_ON_MAC";
#binding-cells = <0>;
capslock-press-duration = <95>;
enable-on-press;
};
/omit-if-no-ref/ capslock_off_mac: behavior_capslock_off_mac {
compatible = "zmk,behavior-capslock";
label = "CAPSLOCK_OFF_MAC";
#binding-cells = <0>;
capslock-press-duration = <95>;
disable-on-release;
};
/omit-if-no-ref/ capslock_hold_mac: behavior_capslock_hold_mac {
compatible = "zmk,behavior-capslock";
label = "CAPSLOCK_HOLD_MAC";
#binding-cells = <0>;
capslock-press-duration = <95>;
enable-on-press;
disable-on-release;
};
/omit-if-no-ref/ capslock_word_mac: behavior_capslock_word_mac {
compatible = "zmk,behavior-capslock";
label = "CAPSLOCK_WORD_MAC";
#binding-cells = <0>;
capslock-press-duration = <95>;
enable-on-press;
disable-on-next-release;
disable-on-keys = <SPACE TAB ENTER ESC>;
};
};
};