Smart-mouse layer
This commit is contained in:
parent
cfe02a6d92
commit
4f8d1f9347
4 changed files with 18 additions and 32 deletions
|
@ -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
|
||||
//╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯
|
||||
)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include "../zmk-nodefree-config/keypos_def/keypos_36keys.h"
|
||||
|
||||
/* map Zen's extra keys */
|
||||
#define X_LH &scroll_mode // thumb row, left
|
||||
#define X_LH &smart_mouse // thumb row, left
|
||||
#define X_RH &kp RET // thumb row, right
|
||||
|
||||
/* activate bluetooth */
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#include <dt-bindings/zmk/mouse.h>
|
||||
|
||||
&mmv {
|
||||
acceleration-exponent = <1>;
|
||||
time-to-max-speed-ms = <40>;
|
||||
delay-ms = <0>;
|
||||
acceleration-exponent = <1>; // 1
|
||||
time-to-max-speed-ms = <1500>; // 40
|
||||
delay-ms = <0>; // 0
|
||||
};
|
||||
|
||||
&mwh {
|
||||
acceleration-exponent = <0>;
|
||||
time-to-max-speed-ms = <40>;
|
||||
delay-ms = <10>;
|
||||
acceleration-exponent = <1>; // 0
|
||||
time-to-max-speed-ms = <5000>; // 40
|
||||
delay-ms = <0>; // 10
|
||||
};
|
||||
|
||||
#define U_MOUSE_MOVE_MAX 600
|
||||
#define U_MOUSE_SCROLL_MAX 10
|
||||
#define U_MOUSE_MOVE_MAX 1250 // 600
|
||||
#define U_MOUSE_SCROLL_MAX 100 // 10
|
||||
|
||||
#undef MOVE_UP
|
||||
#undef MOVE_DOWN
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#define X_MT &none &none // top row, middle
|
||||
#define X_MM &none &none // middle row, middle
|
||||
#define X_MB &none &none // bottom row, middle
|
||||
#define X_LH &none &kp LGUI &scroll_mode // thumb row, left
|
||||
#define X_LH &none &kp LGUI &smart_mouse // thumb row, left
|
||||
#define X_MH &none &none // thumb row, middle
|
||||
#define X_RH &kp RET U_WH_D U_WH_U // thumb row, right
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue