Merge pull request #29 from NoirGuo/soft-off

Soft off
This commit is contained in:
1218 2025-08-22 21:19:57 +08:00 committed by GitHub
commit b29fb8c798
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 38 additions and 3 deletions

View File

@ -42,3 +42,6 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=8
CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=8
#soft off
CONFIG_ZMK_PM_SOFT_OFF=y

View File

@ -26,6 +26,8 @@
trigger-period-ms = <16>;
};
&soft_off { hold-time-ms = <2000>; };
/ {
behaviors {
td0: td0 {
@ -50,6 +52,15 @@
tap-ms = <100>;
};
combos {
compatible = "zmk,combos";
softoff {
bindings = <&soft_off>;
key-positions = <1 15 29>;
};
};
keymap {
compatible = "zmk,keymap";
@ -62,9 +73,7 @@
&kp LGUI &mo 1 &lt 3 SPACE &lt 3 ENTER &mo 2 &kp RALT
>;
sensor-bindings = <&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN>;
sensor-bindings = <&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN>;
};
lower_layer {

View File

@ -540,6 +540,11 @@ rect.held, rect.combo.held {
<rect rx="4" ry="4" x="-20" y="-24" width="40" height="40" class="key"/>
<use href="#mdi:apple-keyboard-option" xlink:href="#mdi:apple-keyboard-option" x="-9" y="-13" height="18" width="18.0" class="key tap glyph mdi:apple-keyboard-option"/>
</g>
<g class="combo combopos-0">
<path d="M103,100 l-13,43" class="combo"/>
<rect rx="6" ry="6" x="89" y="87" width="28" height="26" class="combo"/>
<text x="103" y="100" class="combo tap"><tspan style="font-size: 67%">&amp;soft_off</tspan></text>
</g>
</g>
</g>
<g transform="translate(40, 318)" class="layer-NUMBER">
@ -822,6 +827,11 @@ rect.held, rect.combo.held {
<rect rx="4" ry="4" x="-20" y="-24" width="40" height="40" class="key trans"/>
<use href="#mdi:transfer" xlink:href="#mdi:transfer" x="-9" y="-13" height="18" width="18.0" class="key trans tap glyph mdi:transfer"/>
</g>
<g class="combo combopos-0">
<path d="M103,100 l-13,43" class="combo"/>
<rect rx="6" ry="6" x="89" y="87" width="28" height="26" class="combo"/>
<text x="103" y="100" class="combo tap"><tspan style="font-size: 67%">&amp;soft_off</tspan></text>
</g>
</g>
</g>
<g transform="translate(40, 637)" class="layer-SYMBOL">
@ -1084,6 +1094,11 @@ rect.held, rect.combo.held {
<rect rx="4" ry="4" x="-20" y="-24" width="40" height="40" class="key trans"/>
<use href="#mdi:transfer" xlink:href="#mdi:transfer" x="-9" y="-13" height="18" width="18.0" class="key trans tap glyph mdi:transfer"/>
</g>
<g class="combo combopos-0">
<path d="M103,100 l-13,43" class="combo"/>
<rect rx="6" ry="6" x="89" y="87" width="28" height="26" class="combo"/>
<text x="103" y="100" class="combo tap"><tspan style="font-size: 67%">&amp;soft_off</tspan></text>
</g>
</g>
</g>
<g transform="translate(40, 955)" class="layer-Fn">
@ -1337,6 +1352,11 @@ rect.held, rect.combo.held {
<rect rx="4" ry="4" x="-20" y="-24" width="40" height="40" class="key trans"/>
<use href="#mdi:transfer" xlink:href="#mdi:transfer" x="-9" y="-13" height="18" width="18.0" class="key trans tap glyph mdi:transfer"/>
</g>
<g class="combo combopos-0">
<path d="M103,100 l-13,43" class="combo"/>
<rect rx="6" ry="6" x="89" y="87" width="28" height="26" class="combo"/>
<text x="103" y="100" class="combo tap"><tspan style="font-size: 67%">&amp;soft_off</tspan></text>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@ -196,3 +196,6 @@ layers:
- {type: held alternate}
- {t: '$$mdi:transfer$$', type: trans}
- {t: '$$mdi:transfer$$', type: trans}
combos:
- p: [1, 15, 29]
k: '&soft_off'