Smart-mouse layer

This commit is contained in:
urob 2023-03-05 18:07:29 -05:00
parent cfe02a6d92
commit 4f8d1f9347
4 changed files with 18 additions and 32 deletions

View file

@ -17,14 +17,12 @@
#define NUM 3
#define SYS 4
#define UC 5
#define MWH 6
#define MOUSE 7
#define MOUSE 6
#include "combos.dtsi" // must be sourced after layer-shortcuts
#include "mouse.dtsi"
#include "extra_keys.h"
ZMK_CONDITIONAL_LAYER(FN NAV, MOUSE) // FN + NAV --> MOUSE
ZMK_CONDITIONAL_LAYER(FN NUM, SYS) // FN + NUM --> SYS
/* Navigation keys and misc shortcuts */
@ -119,11 +117,11 @@ ZMK_BEHAVIOR(num_layer_word, hold_tap,
)
#define NUM_WORD &num_layer_word NUM 0
// scroll-mode, requires PR #1366
ZMK_BEHAVIOR(scroll_mode, tri_state,
bindings = <&tog MWH>, <&none>, <&tog MWH>;
ignored-key-positions = <RT2 RM2>;
ignored-layers = <MWH>;
// mouse layer that deactivates automatically on all other keys, requires PR #1366
ZMK_BEHAVIOR(smart_mouse, tri_state,
bindings = <&tog MOUSE>, <&none>, <&tog MOUSE>;
ignored-key-positions = <RT1 RT2 RT3 RM1 RM2 RM3 RH0 RH1>; // mouse keys
ignored-layers = <MOUSE>;
)
// tap: sticky shift | double tap: capsword | triple tap: cancel capsword
@ -300,27 +298,15 @@ ZMK_LAYER(uc,
//╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯ ╰───────────────────────────╯ ╰──────╯
)
ZMK_LAYER(scroll,
//╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮
X_LT ___ ___ ___ ___ ___ X_MT ___ ___ U_WH_U ___ ___ X_RT
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
X_LM ___ ___ ___ ___ ___ X_MM ___ ___ U_WH_D ___ ___ X_RM
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
X_LB ___ ___ ___ ___ ___ X_MB ___ ___ ___ ___ ___ X_RB
//├──────┤ ╰─────────────┼─────────────┴─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┴───────────────────────────╯ ├──────┤
X_LH ___ ___ X_MH ___ ___ X_RH
//╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯
)
ZMK_LAYER(mouse,
//╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮
X_LT ___ ___ ___ ___ ___ X_MT ___ ___ U_MS_U ___ ___ X_RT
X_LT ___ ___ ___ ___ ___ X_MT ___ U_WH_D U_MS_U U_WH_U ___ X_RT
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
X_LM ___ ___ ___ ___ ___ X_MM ___ U_MS_L U_MS_D U_MS_R ___ X_RM
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
X_LB ___ ___ ___ ___ ___ X_MB ___ ___ ___ ___ ___ X_RB
//├──────┤ ╰─────────────┼─────────────┴─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┴───────────────────────────╯ ├──────┤
X_LH ___ ___ X_MH U_BTN1 U_BTN2 X_RH
X_LH ___ ___ X_MH U_BTN2 U_BTN1 X_RH
//╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯
)