This commit is contained in:
snoyer 2023-12-02 20:43:21 +04:00
parent 3be50897c7
commit f268b313a8
3 changed files with 56 additions and 57 deletions

View file

@ -7,58 +7,58 @@
#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;
};
/* 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;
};
};
};
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;
};
/* 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;
};
};
};

View file

@ -28,4 +28,3 @@ properties:
capslock-press-duration:
type: int
default: 95 # seems to be the shortest reliable delay on Mac

View file

@ -58,4 +58,4 @@ capslock_word: behavior_capslock_word {
disable-on-next-release;
enable-while-keys = <A B C ... Z ...>;
};
```
```