Skip to content

Commit

Permalink
feat: restore experimental mouse support
Browse files Browse the repository at this point in the history
  • Loading branch information
lesshonor committed Nov 25, 2024
1 parent 3ba7c4f commit d95154c
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 23 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,27 @@ If you need a 3D model of this keyboard, email `[email protected]`.
## Keymap Diagram

![Diagram of config/eyelash_corne.keymap](keymap-drawer/eyelash_corne.svg "generated by @caksoylar's Keymap Drawer")

## Mouse Support

:warning: This repository defaults to an EXPERIMENTAL mouse movement branch which is slated for eventual merge into ZMK, but is not guaranteed to be stable. For more information, see [beta testing](https://zmk.dev/docs/features/modules#beta-testing) and [PR #2477](https://github.com/zmkfirmware/zmk/pull/2477).

If desired, edit your `config/west.yml` to switch back to `zmkfirmware`'s `main` branch:

```diff
diff --git a/config/west.yml b/config/west.yml
index ac30a68..70ad540 100644
--- a/config/west.yml
+++ b/config/west.yml
@@ -13,8 +13,8 @@ manifest:
url: https://github.com/a741725193/zmk-new_corne
revision: main
- name: zmk
- remote: petejohanson
- revision: feat/pointers-with-input-processors
+ remote: zmkfirmware
+ revision: main
import: app/west.yml
self:
path: config
```
75 changes: 75 additions & 0 deletions boards/arm/eyelash_corne/eyelash_corne.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/mouse.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>

/ {
behaviors {
td0: td0 {
compatible = "zmk,behavior-tap-dance";
#binding-cells = <0>;
bindings = <&kp LEFT_SHIFT>, <&kp CAPS>;
};
};

rgb_encoder: rgb_encoder {
compatible = "zmk,behavior-sensor-rotate";
#sensor-binding-cells = <0>;
bindings = <&rgb_ug RGB_BRI>, <&rgb_ug RGB_BRD>;
};

keymap {
compatible = "zmk,keymap";

default_layer {
display-name = "QWERTY";

bindings = <
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp UP &kp Y &kp U &kp I &kp O &kp P &kp BSPC
&td0 &kp A &kp S &kp D &kp F &kp G &kp LEFT &kp ENTER &kp RIGHT &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LCTRL &kp Z &kp X &kp C &kp V &kp B &kp SPACE &kp DOWN &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ESC
&kp LGUI &mo 1 &lt 3 SPACE &lt 3 ENTER &mo 2 &kp RALT
>;

sensor-bindings = <&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN>;
};

lower_layer {
display-name = "NUMBER";
bindings = <
&trans &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &trans &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC
&trans &bt BT_CLR_ALL &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &trans &mkp LCLK &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp HOME &kp PG_UP
&trans &rgb_ug RGB_OFF &rgb_ug RGB_ON &trans &trans &rgb_ug RGB_EFF &kp C_MUTE &trans &rgb_ug RGB_EFR &rgb_ug RGB_SPI &rgb_ug RGB_BRI &rgb_ug RGB_BRD &kp END &kp PG_DN
&trans &trans &trans &kp INS &kp DEL &trans
>;

sensor-bindings = <&inc_dec_kp PG_UP PG_DN>;
};

raise_layer {
display-name = "SYMBOL";
bindings = <
&trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &trans &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp BSPC
&trans &bt BT_CLR &mkp LCLK &mkp MCLK &mkp RCLK &mkp MB4 &trans &mkp LCLK &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&trans &out OUT_USB &out OUT_BLE &none &none &mkp MB5 &kp C_MUTE &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&trans &trans &kp SPACE &kp RET &trans &trans
>;

sensor-bindings = <&inc_dec_kp PG_UP PG_DN>;
};

layer_3 {
display-name = "Fn";
bindings = <
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &trans &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
&trans &trans &mkp LCLK &mkp MCLK &mkp RCLK &mkp MB4 &trans &mkp LCLK &trans &bootloader &mkp LCLK &mkp MCLK &mkp RCLK &kp PRINTSCREEN &kp F12
&trans &sys_reset &trans &bootloader &trans &mkp MB5 &kp C_MUTE &trans &trans &trans &bootloader &sys_reset &kp SCROLLLOCK &kp PAUSE_BREAK
&trans &trans &trans &trans &trans &trans
>;

sensor-bindings = <&rgb_encoder>;
};
};
};
2 changes: 1 addition & 1 deletion config/eyelash_corne.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ CONFIG_ZMK_RGB_UNDERGLOW_EFF_START=3
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y

# Mouse clicks
# Mouse enable
CONFIG_ZMK_MOUSE=y

CONFIG_ZMK_BACKLIGHT=y
Expand Down
60 changes: 40 additions & 20 deletions config/eyelash_corne.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,28 @@
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>

#include <input/processors.dtsi>

/*

&mmv_input_listener {
input-processors = <&zip_xy_scaler 2 1>;
};

&msc_input_listener {
input-processors = <&zip_xy_scaler 2 1>;
};

*/

#define ZMK_MOUSE_DEFAULT_MOVE_VAL 1200 // 600
#define ZMK_MOUSE_DEFAULT_SCRL_VAL 20 // 10

/ {
behaviors {
td0: td0 {
compatible = "zmk,behavior-tap-dance";
display-name = "Shift/Caps Lock Tap Dance";
#binding-cells = <0>;
bindings = <&kp LEFT_SHIFT>, <&kp CAPS>;
};
Expand All @@ -20,56 +38,58 @@
bindings = <&rgb_ug RGB_BRI>, <&rgb_ug RGB_BRD>;
};

scroll_encoder: scroll_encoder {
compatible = "zmk,behavior-sensor-rotate";
#sensor-binding-cells = <0>;
bindings = <&msc SCRL_DOWN>, <&msc SCRL_UP>;
tap-ms = <30>;
};

keymap {
compatible = "zmk,keymap";

default_layer {
display-name = "QWERTY";

bindings = <
&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp UP &kp Y &kp U &kp I &kp O &kp P &kp BSPC
&td0 &kp A &kp S &kp D &kp F &kp G &kp LEFT &kp ENTER &kp RIGHT &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp LCTRL &kp Z &kp X &kp C &kp V &kp B &kp SPACE &kp DOWN &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp ESC
&kp LGUI &mo 1 &lt 3 SPACE &lt 3 ENTER &mo 2 &kp RALT
>;

sensor-bindings = <&inc_dec_kp C_VOLUME_UP C_VOLUME_DOWN>;
};

lower_layer {
display-name = "NUMBER";
bindings = <
&trans &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &trans &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC
&trans &bt BT_CLR_ALL &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &trans &mkp LCLK &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp HOME &kp PG_UP
&trans &rgb_ug RGB_OFF &rgb_ug RGB_ON &trans &trans &rgb_ug RGB_EFF &kp C_MUTE &trans &rgb_ug RGB_EFR &rgb_ug RGB_SPI &rgb_ug RGB_BRI &rgb_ug RGB_BRD &kp END &kp PG_DN
&trans &trans &trans &kp INS &kp DEL &trans
&trans &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &mmv MOVE_UP &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC
&trans &bt BT_CLR_ALL &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &mmv MOVE_LEFT &mkp LCLK &mmv MOVE_RIGHT &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp HOME &kp PG_UP
&trans &rgb_ug RGB_OFF &rgb_ug RGB_ON &trans &trans &rgb_ug RGB_EFF &kp C_MUTE &mmv MOVE_DOWN &rgb_ug RGB_EFR &rgb_ug RGB_SPI &rgb_ug RGB_BRI &rgb_ug RGB_BRD &kp END &kp PG_DN
&trans &trans &trans &kp INS &kp DEL &trans
>;

sensor-bindings = <&inc_dec_kp PG_UP PG_DN>;
sensor-bindings = <&scroll_encoder>;
};

raise_layer {
display-name = "SYMBOL";
bindings = <
&trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &trans &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp BSPC
&trans &bt BT_CLR &mkp LCLK &mkp MCLK &mkp RCLK &mkp MB4 &trans &mkp LCLK &trans &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&trans &out OUT_USB &out OUT_BLE &none &none &mkp MB5 &kp C_MUTE &trans &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&trans &trans &kp SPACE &kp RET &trans &trans
&trans &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &mmv MOVE_UP &kp CARET &kp AMPS &kp ASTRK &kp LPAR &kp RPAR &kp BSPC
&trans &bt BT_CLR &mkp LCLK &mkp MCLK &mkp RCLK &mkp MB4 &mmv MOVE_LEFT &mkp LCLK &mmv MOVE_RIGHT &kp MINUS &kp EQUAL &kp LBKT &kp RBKT &kp BSLH &kp GRAVE
&trans &out OUT_USB &out OUT_BLE &none &none &mkp MB5 &trans &mmv MOVE_DOWN &kp UNDER &kp PLUS &kp LBRC &kp RBRC &kp PIPE &kp TILDE
&trans &trans &kp SPACE &kp RET &trans &trans
>;

sensor-bindings = <&inc_dec_kp PG_UP PG_DN>;
sensor-bindings = <&scroll_encoder>;
};

layer_3 {
display-name = "Fn";
bindings = <
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &trans &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
&trans &trans &mkp LCLK &mkp MCLK &mkp RCLK &mkp MB4 &trans &mkp LCLK &trans &bootloader &mkp LCLK &mkp MCLK &mkp RCLK &kp PRINTSCREEN &kp F12
&trans &sys_reset &trans &bootloader &trans &mkp MB5 &kp C_MUTE &trans &trans &trans &bootloader &sys_reset &kp SCROLLLOCK &kp PAUSE_BREAK
&trans &trans &trans &trans &trans &trans
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &mmv MOVE_UP &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11
&trans &trans &mkp LCLK &mkp MCLK &mkp RCLK &mkp MB4 &mmv MOVE_LEFT &mkp LCLK &mmv MOVE_RIGHT &bootloader &mkp LCLK &mkp MCLK &mkp RCLK &kp PRINTSCREEN &kp F12
&trans &sys_reset &trans &bootloader &trans &mkp MB5 &kp C_MUTE &mmv MOVE_DOWN &trans &trans &bootloader &sys_reset &kp SCROLLLOCK &kp PAUSE_BREAK
&trans &trans &trans &trans &trans &trans
>;

sensor-bindings = <&rgb_encoder>;
sensor-bindings = <&scroll_encoder>;
};
};
};
6 changes: 4 additions & 2 deletions config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ manifest:
# See:
# - https://zmk.dev/docs/features/modules
# - https://docs.zephyrproject.org/3.5.0/develop/west/manifest.html#projects
- name: petejohanson
url-base: https://github.com/petejohanson
projects:
- name: eyelash_corne
url: https://github.com/a741725193/zmk-new_corne
revision: main
- name: zmk
remote: zmkfirmware
revision: main
remote: petejohanson
revision: feat/pointers-with-input-processors
import: app/west.yml
self:
path: config

0 comments on commit d95154c

Please sign in to comment.