Skip to content

Commit

Permalink
keymap: dynamic: Add layer for window switch
Browse files Browse the repository at this point in the history
  • Loading branch information
xingrz committed Oct 11, 2023
1 parent 0cd1827 commit e023aeb
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/boards/arm/hw75_dynamic/app/screen/icons.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ICON_VOL,f1ae
ICON_SCR,f18a
ICON_TASKS,f15e
ICON_ARROW_VER,f193
ICON_ARROW_HOR,f19c
ICON_CALI,f183
Expand Down
1 change: 1 addition & 0 deletions config/boards/arm/hw75_dynamic/app/screen/strings.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
STRING_LAYER_VOL,音量
STRING_LAYER_SCR,滚动
STRING_LAYER_TASKS,窗口
STRING_LAYER_ARROW_VER,上下
STRING_LAYER_ARROW_HOR,左右
STRING_KNOB_CALIB,电机校准中
Expand Down
39 changes: 39 additions & 0 deletions config/hw75_dynamic.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,37 @@
#include <dt-bindings/zmk/mouse.h>

/ {
macros {
tasks_forward: tasks-forward {
label = "TAKS_FORWARD";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&macro_press &kp LALT>,
<&macro_tap &kp TAB>,
<&macro_release &kp LALT>;
};

tasks_backward: tasks-backward {
label = "TAKS_BACKWARD";
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&macro_press &kp LALT>,
<&macro_press &kp LSHIFT>,
<&macro_tap &kp TAB>,
<&macro_release &kp LSHIFT>,
<&macro_release &kp LALT>;
};
};

behaviors {
switch_tasks: switch-tasks {
compatible = "zmk,behavior-sensor-rotate";
label = "SWITCH_TASKS";
#sensor-binding-cells = <0>;
bindings = <&tasks_forward>, <&tasks_backward>;
};
};

keymap {
compatible = "zmk,keymap-ext", "zmk,keymap";

Expand All @@ -29,6 +60,14 @@
sensor-bindings = <&mw MW_UP(1) MW_DN(1)>;
};

tasks {
label = "窗口";
icon = [EF 85 9E];
bindings = <&trans &trans>;
sensor-bindings = <&switch_tasks>;
profile = <&profile_spring>;
};

arrow_vertical {
label = "上下";
icon = [EF 86 93];
Expand Down

0 comments on commit e023aeb

Please sign in to comment.