Adaptive double-space a la iOS
* double space morphs into `DOT SPACE STICKY-SHIFT` * using adaptive key instead of tap-dance to avoid delay on single shift * shift + space yields protected space so one can type double spaces
This commit is contained in:
parent
ff962c3166
commit
548231cee3
2 changed files with 68 additions and 40 deletions
|
@ -18,6 +18,7 @@
|
|||
#define SYS 4
|
||||
#define UC 5
|
||||
#define MOUSE 6
|
||||
#define SPACE_LAYER 7
|
||||
|
||||
#include "combos.dtsi" // requires layer aliases
|
||||
#include "mouse.dtsi"
|
||||
|
@ -31,7 +32,7 @@
|
|||
#define QUICK_TAP_MS 175
|
||||
|
||||
&sk { // sticky-key config
|
||||
release-after-ms = <600>; // release after 0.6s
|
||||
release-after-ms = <1200>; // release after 1.2s
|
||||
quick-release; // no double capitalization when rolling keys
|
||||
};
|
||||
|
||||
|
@ -180,7 +181,7 @@ ZMK_BEHAVIOR(qexcl, mod_morph,
|
|||
mods = <(MOD_LSFT|MOD_RSFT)>;
|
||||
)
|
||||
|
||||
// tap: space | shift + tap: dot -> space -> sticky shift | hold: activate layer
|
||||
// tap: space | double-tap: dot -> space -> sticky shift | shift + tap: protected space | hold: activate layer
|
||||
ZMK_BEHAVIOR(lt_spc, hold_tap,
|
||||
flavor = "balanced";
|
||||
tapping-term-ms = <200>;
|
||||
|
@ -188,13 +189,28 @@ ZMK_BEHAVIOR(lt_spc, hold_tap,
|
|||
bindings = <&mo>, <&spc_morph>;
|
||||
)
|
||||
ZMK_BEHAVIOR(spc_morph, mod_morph,
|
||||
bindings = <&kp SPACE>, <&dot_spc>;
|
||||
bindings = <&spc_layer>, <&kp SPACE>;
|
||||
mods = <(MOD_LSFT|MOD_RSFT)>;
|
||||
)
|
||||
ZMK_BEHAVIOR(spc_layer, macro,
|
||||
wait-ms = <0>;
|
||||
tap-ms = <5>;
|
||||
bindings = <&kp SPACE &sl SPACE_LAYER>;
|
||||
)
|
||||
ZMK_BEHAVIOR(lt_spc2, hold_tap,
|
||||
flavor = "balanced";
|
||||
tapping-term-ms = <200>;
|
||||
quick-tap-ms = <QUICK_TAP_MS>;
|
||||
bindings = <&mo>, <&spc_morph2>;
|
||||
)
|
||||
ZMK_BEHAVIOR(spc_morph2, mod_morph,
|
||||
bindings = <&dot_spc>, <&kp SPACE>;
|
||||
mods = <(MOD_LSFT|MOD_RSFT)>;
|
||||
)
|
||||
ZMK_BEHAVIOR(dot_spc, macro,
|
||||
wait-ms = <0>;
|
||||
tap-ms = <5>;
|
||||
bindings = <&kp DOT &kp SPACE &sk LSHFT>;
|
||||
bindings = <&kp BSPC &kp DOT &kp SPACE &sk LSHIFT>;
|
||||
)
|
||||
|
||||
// tap: backspace | lshft + tap: delete | rshft + tap: shift-delete
|
||||
|
@ -323,4 +339,16 @@ ZMK_LAYER(mouse,
|
|||
//╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯
|
||||
)
|
||||
|
||||
ZMK_LAYER(space,
|
||||
//╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮
|
||||
X_LT ___ ___ ___ ___ ___ X_MT ___ ___ ___ ___ ___ X_RT
|
||||
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
|
||||
X_LM ___ ___ ___ ___ ___ X_MM ___ ___ ___ ___ ___ X_RM
|
||||
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
|
||||
X_LB ___ ___ ___ ___ ___ X_MB ___ ___ ___ ___ ___ X_RB
|
||||
//├──────┤ ╰─────────────┼─────────────┴─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┴───────────────────────────╯ ├──────┤
|
||||
X_LH <_spc2 NAV 0 ___ X_MH ___ ___ X_RH
|
||||
//╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯
|
||||
)
|
||||
|
||||
/* vim: set ft=c tw=174: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue