Skip to content

Commit

Permalink
keymap: dynamic: Add layers for arrow keys emulation
Browse files Browse the repository at this point in the history
  • Loading branch information
xingrz committed Sep 20, 2023
1 parent 7a0153d commit c70e6c0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/boards/arm/hw75_dynamic/app/screen/icons.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ICON_VOL,f1ae
ICON_SCR,f193
ICON_SCR,f18a
ICON_ARROW_VER,f193
ICON_ARROW_HOR,f19c
ICON_CALI,f183
ICON_ERROR,f134
2 changes: 2 additions & 0 deletions config/boards/arm/hw75_dynamic/app/screen/layer_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ LV_FONT_DECLARE(zfull_9);
static const char *layer_icons[KEYMAP_LAYERS_NUM] = {
ICON_VOL,
ICON_SCR,
ICON_ARROW_VER,
ICON_ARROW_HOR,
};

static const char *layer_names[KEYMAP_LAYERS_NUM] = { DT_FOREACH_CHILD(KEYMAP_NODE, LAYER_LABEL) };
Expand Down
2 changes: 2 additions & 0 deletions config/boards/arm/hw75_dynamic/app/screen/strings.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
STRING_LAYER_VOL,音量
STRING_LAYER_SCR,滚动
STRING_LAYER_ARROW_VER,上下
STRING_LAYER_ARROW_HOR,左右
STRING_KNOB_CALIB,电机校准中
STRING_KNOB_CALIB_FAIL,校准失败
13 changes: 13 additions & 0 deletions config/hw75_dynamic.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/ {
keymap {
compatible = "zmk,keymap";

volume {
label = "音量";
bindings = <&lvkp LV_KEY_PREV &lvkp LV_KEY_NEXT>;
Expand All @@ -25,5 +26,17 @@
bindings = <&trans &trans>;
sensor-bindings = <&mw MW_UP(1) MW_DN(1)>;
};

arrow_vertical {
label = "上下";
bindings = <&lvkp LV_KEY_PREV &lvkp LV_KEY_NEXT>;
sensor-bindings = <&inc_dec_kp UP DOWN>;
};

arrow_horizontal {
label = "左右";
bindings = <&lvkp LV_KEY_PREV &lvkp LV_KEY_NEXT>;
sensor-bindings = <&inc_dec_kp LEFT RIGHT>;
};
};
};

0 comments on commit c70e6c0

Please sign in to comment.