diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d74fb89..34b3732 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,4 +2,4 @@ on: [push, pull_request, workflow_dispatch] jobs: build: - uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main + uses: sky-bro/zmk/.github/workflows/build-user-config.yml@k4i-sweep-kbd diff --git a/README.org b/README.org new file mode 100644 index 0000000..1516ab2 --- /dev/null +++ b/README.org @@ -0,0 +1,6 @@ +#+Title: k4i's split kbd + +* References + +- [[https://github.com/davidphilipbarr/Sweep][Sweep Repo]] +- [[https://www.youtube.com/watch?v=VShLPvF693k][keymap I initially copied]] diff --git a/config/cradio.conf b/config/cradio.conf index 8871a8b..c09a5bb 100644 --- a/config/cradio.conf +++ b/config/cradio.conf @@ -1,3 +1,6 @@ +# Turn on logging, and set ZMK logging to debug output +CONFIG_ZMK_USB_LOGGING=n + # Bluetooth CONFIG_BT_MAX_CONN=5 CONFIG_BT_MAX_PAIRED=5 @@ -11,6 +14,17 @@ CONFIG_ZMK_IDLE_TIMEOUT=30000 CONFIG_ZMK_SLEEP=y CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 +# MOUSE +CONFIG_ZMK_MOUSE=y + +# WPM: inacurate, disabled by default +CONFIG_ZMK_WPM=n + +# REPORT +CONFIG_ZMK_BEHAVIORS_QUEUE_SIZE=512 +CONFIG_ZMK_SEND_STRING_DEFAULT_WAIT_MS=10 +CONFIG_ZMK_SEND_STRING_DEFAULT_TAP_MS=10 + # System # length <= 16 -CONFIG_ZMK_KEYBOARD_NAME="k4i's split kbd" \ No newline at end of file +CONFIG_ZMK_KEYBOARD_NAME="sweep split kbd" diff --git a/config/cradio.keymap b/config/cradio.keymap index 0f3dacb..d6cf484 100644 --- a/config/cradio.keymap +++ b/config/cradio.keymap @@ -1,18 +1,35 @@ // Copyright (c) 2022 The ZMK Contributors // SPDX-License-Identifier: MIT +#include "mouse.dtsi" #include #include #include #include +#include #define MAC 0 #define WIN 1 #define RIG 2 #define LEF 3 #define TRI 4 +#define MOUSE 5 + + +#define U_MS_U &mmv MOVE_UP +#define U_MS_D &mmv MOVE_DOWN +#define U_MS_L &mmv MOVE_LEFT +#define U_MS_R &mmv MOVE_RIGHT +#define U_WH_U &msc SCRL_UP +#define U_WH_D &msc SCRL_DOWN +#define U_WH_L &msc SCRL_LEFT +#define U_WH_R &msc SCRL_RIGHT + / { + chosen { + zmk,charmap = &charmap_us; + }; behaviors { ht: hold_tap { label = "hold_tap"; @@ -43,7 +60,7 @@ &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp A &ht LALT S &ht LCTRL D &ht LGUI F &kp G &kp H &ht RGUI J &ht RCTRL K &ht RALT L &kp BSPC &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp ENTER - < LEF TAB &kp LSHIFT &kp SPACE < RIG TAB + < LEF TAB &kp LSHIFT &kp SPACE < RIG TAB >; }; @@ -52,15 +69,15 @@ &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp A &ht LALT S &ht LGUI D &ht LCTRL F &kp G &kp H &ht RCTRL J &ht RGUI K &ht RALT L &kp BSPC &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp ENTER - < LEF TAB &kp LSHIFT &kp SPACE < RIG TAB + < LEF TAB &kp LSHIFT &kp SPACE < RIG TAB >; }; right_layer { bindings = < &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 -&kp DEL &kp CAPS &kp PSCRN &kp INS &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT -&trans &trans &trans &trans &trans &trans &kp HOME &kp PG_DN &kp PG_UP &kp END +&kp DEL &kp CAPS &kp PSCRN &kp INS &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &trans +&trans &trans &trans &trans &trans &kp HOME &kp PG_DN &kp PG_UP &kp END &bootloader &trans &kp ESC &trans &trans >; }; @@ -68,19 +85,28 @@ left_layer { bindings = < &kp EXCL &kp AT &kp HASH &kp DLLR &kp PRCNT &kp CARET &kp AMPS &kp ASTRK &kp GRAVE &kp TILDE -&kp DQT &kp LBKT &kp LBRC &kp LPAR &trans &kp FSLH &kp MINUS &kp EQUAL &kp COLON &kp SEMI -&kp SQT &kp RBKT &kp RBRC &kp RPAR &trans &kp BSLH &kp UNDER &kp PLUS &kp PIPE &kp QMARK - &trans &trans &trans &trans +&kp DQT &kp LBKT &kp LBRC &kp LPAR &default_report &kp FSLH &kp MINUS &kp EQUAL &kp COLON &kp SEMI +&kp SQT &kp RBKT &kp RBRC &kp RPAR &bootloader &kp BSLH &kp UNDER &kp PLUS &kp PIPE &kp QMARK + &trans &trans &tog MOUSE &trans >; }; tri_layer { bindings = < -&kp F1 &kp F2 &kp F3 &kp F4 &bt BT_SEL 0 &bt BT_SEL 2 &out OUT_TOG &tog WIN &kp C_MUTE &kp C_NEXT +&kp F1 &kp F2 &kp F3 &kp F4 &bt BT_SEL 0 &bt BT_SEL 2 &out OUT_TOG &tog WIN &kp C_MUTE &kp C_PREV &kp F5 &kp F6 &kp F7 &kp F8 &bt BT_SEL 1 &bt BT_SEL 3 &kp C_BRI_UP &trans &kp C_VOL_UP &kp C_PP -&kp F9 &kp F10 &kp F11 &kp F12 &bt BT_CLR &bt BT_SEL 4 &kp C_BRI_DEC &trans &kp C_VOL_DN &kp C_PREV +&kp F9 &kp F10 &kp F11 &kp F12 &bt BT_CLR &bt BT_SEL 4 &kp C_BRI_DEC &trans &kp C_VOL_DN &kp C_NEXT &trans &trans &trans &trans >; }; + + mouse { + bindings = < +&tog MOUSE &mkp MB4 &mkp MCLK &mkp MB5 &trans U_WH_L U_WH_D U_WH_U U_WH_R &tog MOUSE +&trans &trans &trans &trans &trans U_MS_L U_MS_D U_MS_U U_MS_R &trans +&trans &trans &trans &trans &trans &trans &mkp MB4 &mkp MCLK &mkp MB5 &trans + &kp SPACE &kp LSHIFT &mkp LCLK &mkp RCLK + >; + }; }; }; diff --git a/config/mouse.dtsi b/config/mouse.dtsi new file mode 100644 index 0000000..1d35ba6 --- /dev/null +++ b/config/mouse.dtsi @@ -0,0 +1,26 @@ +#define ZMK_MOUSE_DEFAULT_MOVE_VAL 2500 // 600 +#define ZMK_MOUSE_DEFAULT_SCRL_VAL 20 // 10 + +#include +#include + +&mmv { + acceleration-exponent = <1>; // 1 + time-to-max-speed-ms = <300>; // 40 + delay-ms = <0>; // 0 +}; + +&msc { + acceleration-exponent = <0>; // 0 + time-to-max-speed-ms = <40>; // 500 + delay-ms = <0>; // 10 +}; + +#define U_MS_U &mmv MOVE_UP +#define U_MS_D &mmv MOVE_DOWN +#define U_MS_L &mmv MOVE_LEFT +#define U_MS_R &mmv MOVE_RIGHT +#define U_WH_U &msc SCRL_UP +#define U_WH_D &msc SCRL_DOWN +#define U_WH_L &msc SCRL_LEFT +#define U_WH_R &msc SCRL_RIGHT diff --git a/config/west.yml b/config/west.yml index b886cbe..5712675 100644 --- a/config/west.yml +++ b/config/west.yml @@ -5,9 +5,13 @@ manifest: # Additional modules containing boards/shields/custom code can be listed here as well # See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects projects: + # - name: zmk + # remote: zmkfirmware + # revision: main + # import: app/west.yml - name: zmk - remote: zmkfirmware - revision: main + url: https://github.com/sky-bro/zmk + revision: k4i-sweep-kbd import: app/west.yml self: path: config