From 21cf4e5154af2864e0f35b21080e11dc29989630 Mon Sep 17 00:00:00 2001 From: eXsoR65 Date: Tue, 24 Dec 2024 19:43:42 -0500 Subject: [PATCH] init commit --- .github/workflows/build.yml | 5 + boards/shields/.gitkeep | 0 boards/shields/charybdis/Kconfig.defconfig | 16 ++ boards/shields/charybdis/Kconfig.shield | 8 + boards/shields/charybdis/charybdis.conf | 0 boards/shields/charybdis/charybdis.dtsi | 161 +++++++++++ boards/shields/charybdis/charybdis.keymap | 51 ++++ boards/shields/charybdis/charybdis.zmk.yml | 13 + boards/shields/charybdis/charybdis_3610.dtsi | 52 ++++ .../shields/charybdis/charybdis_dongle.conf | 8 + .../charybdis/charybdis_dongle.overlay | 18 ++ boards/shields/charybdis/charybdis_left.conf | 1 + .../shields/charybdis/charybdis_left.overlay | 21 ++ boards/shields/charybdis/charybdis_right.conf | 18 ++ .../shields/charybdis/charybdis_right.overlay | 35 +++ .../shields/charybdis/split_input_common.dtsi | 50 ++++ build.yaml | 46 +++ config/charybdis.conf | 2 + config/charybdis.json | 98 +++++++ config/charybdis.keymap | 230 +++++++++++++++ config/corne.conf | 12 + config/corne.json | 101 +++++++ config/corne.keymap | 272 ++++++++++++++++++ config/west.yml | 21 ++ zephyr/module.yml | 4 + 25 files changed, 1243 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 boards/shields/.gitkeep create mode 100644 boards/shields/charybdis/Kconfig.defconfig create mode 100644 boards/shields/charybdis/Kconfig.shield create mode 100644 boards/shields/charybdis/charybdis.conf create mode 100644 boards/shields/charybdis/charybdis.dtsi create mode 100644 boards/shields/charybdis/charybdis.keymap create mode 100644 boards/shields/charybdis/charybdis.zmk.yml create mode 100644 boards/shields/charybdis/charybdis_3610.dtsi create mode 100644 boards/shields/charybdis/charybdis_dongle.conf create mode 100644 boards/shields/charybdis/charybdis_dongle.overlay create mode 100644 boards/shields/charybdis/charybdis_left.conf create mode 100644 boards/shields/charybdis/charybdis_left.overlay create mode 100644 boards/shields/charybdis/charybdis_right.conf create mode 100644 boards/shields/charybdis/charybdis_right.overlay create mode 100644 boards/shields/charybdis/split_input_common.dtsi create mode 100644 build.yaml create mode 100644 config/charybdis.conf create mode 100644 config/charybdis.json create mode 100644 config/charybdis.keymap create mode 100644 config/corne.conf create mode 100644 config/corne.json create mode 100644 config/corne.keymap create mode 100644 config/west.yml create mode 100644 zephyr/module.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..d74fb89 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,5 @@ +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main diff --git a/boards/shields/.gitkeep b/boards/shields/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/boards/shields/charybdis/Kconfig.defconfig b/boards/shields/charybdis/Kconfig.defconfig new file mode 100644 index 0000000..30fcb5d --- /dev/null +++ b/boards/shields/charybdis/Kconfig.defconfig @@ -0,0 +1,16 @@ +if SHIELD_CHARYBDIS_DONGLE + +config ZMK_KEYBOARD_NAME + default "Charybdis" + +config ZMK_SPLIT_ROLE_CENTRAL + default y + +endif + +if SHIELD_CHARYBDIS_DONGLE || SHIELD_CHARYBDIS_LEFT || SHIELD_CHARYBDIS_RIGHT + +config ZMK_SPLIT + default y + +endif diff --git a/boards/shields/charybdis/Kconfig.shield b/boards/shields/charybdis/Kconfig.shield new file mode 100644 index 0000000..88d8453 --- /dev/null +++ b/boards/shields/charybdis/Kconfig.shield @@ -0,0 +1,8 @@ +config SHIELD_CHARYBDIS_DONGLE + def_bool $(shields_list_contains,charybdis_dongle) + +config SHIELD_CHARYBDIS_LEFT + def_bool $(shields_list_contains,charybdis_left) + +config SHIELD_CHARYBDIS_RIGHT + def_bool $(shields_list_contains,charybdis_right) \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis.conf b/boards/shields/charybdis/charybdis.conf new file mode 100644 index 0000000..e69de29 diff --git a/boards/shields/charybdis/charybdis.dtsi b/boards/shields/charybdis/charybdis.dtsi new file mode 100644 index 0000000..0ea9a02 --- /dev/null +++ b/boards/shields/charybdis/charybdis.dtsi @@ -0,0 +1,161 @@ +#include +#include + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,physical-layout = &charybdis_6col_layout; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <12>; + rows = <4>; + + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,11) RC(0,10) RC(0,9) RC(0,8) RC(0,7) RC(0,6) + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,11) RC(1,10) RC(1,9) RC(1,8) RC(1,7) RC(1,6) + RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,11) RC(2,10) RC(2,9) RC(2,8) RC(2,7) RC(2,6) + RC(3,3) RC(3,4) RC(3,1) RC(3,7) RC(3,9) + >; + }; + + five_column_transform: keymap_transform_1 { + compatible = "zmk,matrix-transform"; + columns = <10>; + rows = <4>; + + map = < + RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,10) RC(0,9) RC(0,8) RC(0,7) RC(0,6) + RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,10) RC(1,9) RC(1,8) RC(1,7) RC(1,6) + RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,10) RC(2,9) RC(2,8) RC(2,7) RC(2,6) + RC(3,3) RC(3,4) RC(3,1) RC(3,6) RC(3,8) + >; + }; + + kscan0: kscan { + diode-direction = "row2col"; + }; + + charybdis_6col_layout: charybdis_6col_layout { + compatible = "zmk,physical-layout"; + display-name = "6-column"; + + transform = <&default_transform>; + + keys // w h x y rot rx ry + = <&key_physical_attrs 100 100 0 57 0 0 0> + , <&key_physical_attrs 100 100 100 57 0 0 0> + , <&key_physical_attrs 100 100 200 12 0 0 0> + , <&key_physical_attrs 100 100 300 0 0 0 0> + , <&key_physical_attrs 100 100 400 12 0 0 0> + , <&key_physical_attrs 100 100 500 12 0 0 0> + , <&key_physical_attrs 100 100 900 12 0 0 0> + , <&key_physical_attrs 100 100 1000 12 0 0 0> + , <&key_physical_attrs 100 100 1100 0 0 0 0> + , <&key_physical_attrs 100 100 1200 12 0 0 0> + , <&key_physical_attrs 100 100 1300 57 0 0 0> + , <&key_physical_attrs 100 100 1400 57 0 0 0> + , <&key_physical_attrs 100 100 0 157 0 0 0> + , <&key_physical_attrs 100 100 100 157 0 0 0> + , <&key_physical_attrs 100 100 200 112 0 0 0> + , <&key_physical_attrs 100 100 300 100 0 0 0> + , <&key_physical_attrs 100 100 400 112 0 0 0> + , <&key_physical_attrs 100 100 500 112 0 0 0> + , <&key_physical_attrs 100 100 900 112 0 0 0> + , <&key_physical_attrs 100 100 1000 112 0 0 0> + , <&key_physical_attrs 100 100 1100 100 0 0 0> + , <&key_physical_attrs 100 100 1200 112 0 0 0> + , <&key_physical_attrs 100 100 1300 157 0 0 0> + , <&key_physical_attrs 100 100 1400 157 0 0 0> + , <&key_physical_attrs 100 100 0 257 0 0 0> + , <&key_physical_attrs 100 100 100 257 0 0 0> + , <&key_physical_attrs 100 100 200 212 0 0 0> + , <&key_physical_attrs 100 100 300 200 0 0 0> + , <&key_physical_attrs 100 100 400 212 0 0 0> + , <&key_physical_attrs 100 100 500 212 0 0 0> + , <&key_physical_attrs 100 100 900 212 0 0 0> + , <&key_physical_attrs 100 100 1000 212 0 0 0> + , <&key_physical_attrs 100 100 1100 200 0 0 0> + , <&key_physical_attrs 100 100 1200 212 0 0 0> + , <&key_physical_attrs 100 100 1300 257 0 0 0> + , <&key_physical_attrs 100 100 1400 257 0 0 0> + , <&key_physical_attrs 100 100 348 312 0 0 0> + , <&key_physical_attrs 100 100 348 312 1500 398 789> + , <&key_physical_attrs 100 100 348 312 3000 398 789> + , <&key_physical_attrs 100 100 1052 312 (-3000) 1102 789> + , <&key_physical_attrs 100 100 1052 312 (-1500) 1102 789> + ; + }; + + charybdis_5col_layout: charybdis_5col_layout{ + compatible = "zmk,physical-layout"; + display-name = "5-column"; + + transform = <&five_column_transform>; + + keys // w h x y rot rx ry + = <&key_physical_attrs 100 100 0 57 0 0 0> + , <&key_physical_attrs 100 100 100 12 0 0 0> + , <&key_physical_attrs 100 100 200 0 0 0 0> + , <&key_physical_attrs 100 100 300 12 0 0 0> + , <&key_physical_attrs 100 100 400 12 0 0 0> + , <&key_physical_attrs 100 100 800 12 0 0 0> + , <&key_physical_attrs 100 100 900 12 0 0 0> + , <&key_physical_attrs 100 100 1000 0 0 0 0> + , <&key_physical_attrs 100 100 1100 12 0 0 0> + , <&key_physical_attrs 100 100 1200 57 0 0 0> + , <&key_physical_attrs 100 100 0 157 0 0 0> + , <&key_physical_attrs 100 100 100 112 0 0 0> + , <&key_physical_attrs 100 100 200 100 0 0 0> + , <&key_physical_attrs 100 100 300 112 0 0 0> + , <&key_physical_attrs 100 100 400 112 0 0 0> + , <&key_physical_attrs 100 100 800 112 0 0 0> + , <&key_physical_attrs 100 100 900 112 0 0 0> + , <&key_physical_attrs 100 100 1000 100 0 0 0> + , <&key_physical_attrs 100 100 1100 112 0 0 0> + , <&key_physical_attrs 100 100 1200 157 0 0 0> + , <&key_physical_attrs 100 100 0 257 0 0 0> + , <&key_physical_attrs 100 100 100 212 0 0 0> + , <&key_physical_attrs 100 100 200 200 0 0 0> + , <&key_physical_attrs 100 100 300 212 0 0 0> + , <&key_physical_attrs 100 100 400 212 0 0 0> + , <&key_physical_attrs 100 100 800 212 0 0 0> + , <&key_physical_attrs 100 100 900 212 0 0 0> + , <&key_physical_attrs 100 100 1000 200 0 0 0> + , <&key_physical_attrs 100 100 1100 212 0 0 0> + , <&key_physical_attrs 100 100 1200 257 0 0 0> + , <&key_physical_attrs 100 100 248 312 0 0 0> + , <&key_physical_attrs 100 100 248 312 1500 298 789> + , <&key_physical_attrs 100 100 248 312 3000 298 789> + , <&key_physical_attrs 100 100 952 312 (-3000) 1002 789> + , <&key_physical_attrs 100 100 952 312 (-1500) 1002 789> + ; + }; + + charybdis_position_map { + compatible = "zmk,physical-layout-position-map"; + + complete; + + twelve { + physical-layout = <&charybdis_6col_layout>; + positions + = < 0 1 2 3 4 5 6 7 8 9 10 11 > + , <12 13 14 15 16 17 18 19 20 21 22 23 > + , <24 25 26 27 28 29 30 31 32 33 34 35 > + , < 36 37 38 39 40 > + ; + }; + + ten { + physical-layout = <&charybdis_5col_layout>; + positions + = <35 0 1 2 3 4 5 6 7 8 9 36> + , <37 10 11 12 13 14 15 16 17 18 19 38> + , <39 20 21 22 23 24 25 26 27 28 29 40> + , < 30 31 32 33 34 > + ; + }; + }; +}; \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis.keymap b/boards/shields/charybdis/charybdis.keymap new file mode 100644 index 0000000..69ae7d4 --- /dev/null +++ b/boards/shields/charybdis/charybdis.keymap @@ -0,0 +1,51 @@ +#include +#include +#include +#include + +/ { + trackball_listener { + compatible = "zmk,input-listener"; + device = <&vtrackball>; + }; + + keymap { + compatible = "zmk,keymap"; + + Base { + bindings = < + &kp LGUI &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp RGUI + &kp RCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp RCTRL + &kp LSHIFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT < 7 SLASH &kp RSHIFT + &kp BSPC &kp SPACE &mo 1 &mo 2 &kp RET + >; + }; + + Lower { + bindings = < + &none &none &kp C_NEXT &kp C_PP &kp C_PREV &none &kp LBKT &kp N7 &kp N8 &kp N9 &kp RBKT &none + &none &kp LGUI &kp LALT &kp LCTRL &kp LSHIFT &none &kp KP_PLUS &kp N4 &kp N5 &kp N6 &kp KP_MINUS &none + &none &none &none &none &none &bootloader &kp KP_MULTIPLY &kp N1 &kp N2 &kp N3 &kp KP_SLASH &none + &none &none &trans &none &trans + >; + }; + + Raise { + bindings = < + &none &none &none &none &none &none &none &kp C_VOL_UP &kp C_MUTE &kp C_VOL_DN &none &none + &none &kp LEFT &kp UP &kp DOWN &kp RIGHT &none &none &kp RSHIFT &kp RCTRL &kp RALT &kp RGUI &none + &none &kp HOME &kp PG_UP &kp PG_DN &kp END &none &none &none &none &none &none &none + &trans &trans &none &trans &none + >; + }; + + Pointer { + bindings = < + &bootloader &none &none &none &none &none &none &none &none &none &none &bootloader + &none &kp LGUI &kp LALT &kp LCTRL &kp LSHIFT &none &none &kp RSHIFT &kp RCTRL &kp RALT &kp RGUI &none + &none &none &none &none &none &none &none &none &none &none &none &none + &mkp MB2 &mkp MB1 &mkp MB3 &mkp MB3 &mkp MB1 + >; + }; + }; +}; diff --git a/boards/shields/charybdis/charybdis.zmk.yml b/boards/shields/charybdis/charybdis.zmk.yml new file mode 100644 index 0000000..a4550c4 --- /dev/null +++ b/boards/shields/charybdis/charybdis.zmk.yml @@ -0,0 +1,13 @@ +file_format: "1" +id: charybdis +name: Charybdis +type: shield +url: https://github.com/bastardkb/charybdis/ +requires: [pro_micro] +features: + - keys + - pointer +siblings: + - charybdis_dongle + - charybdis_left + - charybdis_right \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis_3610.dtsi b/boards/shields/charybdis/charybdis_3610.dtsi new file mode 100644 index 0000000..c76e5b3 --- /dev/null +++ b/boards/shields/charybdis/charybdis_3610.dtsi @@ -0,0 +1,52 @@ +#define INPUT_EV_KEY 0x01 /**< Key event */ +#define INPUT_EV_REL 0x02 /**< Relative coordinate event */ +#define INPUT_EV_ABS 0x03 /**< Absolute coordinate event */ +#define INPUT_EV_MSC 0x04 /**< Miscellaneous event */ +#define INPUT_EV_VENDOR_START 0xf0 /**< Vendor specific event start */ +#define INPUT_EV_VENDOR_STOP 0xff /**< Vendor specific event stop */ + +#define INPUT_REL_X 0x00 /**< Relative X coordinate */ +#define INPUT_REL_Y 0x01 /**< Relative Y coordinate */ +#define INPUT_REL_WHEEL 0x08 /**< Relative wheel coordinate */ +#define INPUT_REL_HWHEEL 0x06 /**< Relative horizontal wheel coordinate */ +#define INPUT_REL_MISC 0x09 /**< Relative misc coordinate */ + +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; + + spi0_sleep: spi0_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + +&spi0 { + status = "okay"; + compatible = "nordic,nrf-spim"; + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; + cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; + + trackball: trackball@0 { + status = "okay"; + compatible = "pixart,pmw3610"; + reg = <0>; + spi-max-frequency = <2000000>; + irq-gpios = <&gpio0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + cpi = <800>; + evt-type = ; + x-input-code = ; + y-input-code = ; + }; +}; diff --git a/boards/shields/charybdis/charybdis_dongle.conf b/boards/shields/charybdis/charybdis_dongle.conf new file mode 100644 index 0000000..8149f82 --- /dev/null +++ b/boards/shields/charybdis/charybdis_dongle.conf @@ -0,0 +1,8 @@ +CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2 +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y + +CONFIG_INPUT=y +CONFIG_ZMK_POINTING=y +CONFIG_ZMK_POINTING_SMOOTH_SCROLLING=y + +CONFIG_ZMK_SLEEP=n diff --git a/boards/shields/charybdis/charybdis_dongle.overlay b/boards/shields/charybdis/charybdis_dongle.overlay new file mode 100644 index 0000000..73ea042 --- /dev/null +++ b/boards/shields/charybdis/charybdis_dongle.overlay @@ -0,0 +1,18 @@ +#include "charybdis.dtsi" +#include "split_input_common.dtsi" +/ { + chosen { + zmk,kscan = &mock_kscan; + }; + + mock_kscan: kscan_1 { + compatible = "zmk,kscan-mock"; + columns = <0>; + rows = <0>; + events = <0>; + }; +}; + +&trackball_listener { + status = "okay"; +}; diff --git a/boards/shields/charybdis/charybdis_left.conf b/boards/shields/charybdis/charybdis_left.conf new file mode 100644 index 0000000..9ce5b96 --- /dev/null +++ b/boards/shields/charybdis/charybdis_left.conf @@ -0,0 +1 @@ +CONFIG_INPUT=y \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis_left.overlay b/boards/shields/charybdis/charybdis_left.overlay new file mode 100644 index 0000000..bb0cc31 --- /dev/null +++ b/boards/shields/charybdis/charybdis_left.overlay @@ -0,0 +1,21 @@ +#include "charybdis.dtsi" + +&kscan0 { + compatible = "zmk,kscan-gpio-matrix"; + + col-gpios + = <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + row-gpios + = <&pro_micro 18 GPIO_ACTIVE_HIGH> + , <&pro_micro 5 GPIO_ACTIVE_HIGH> + , <&pro_micro 4 GPIO_ACTIVE_HIGH> + , <&pro_micro 9 GPIO_ACTIVE_HIGH> + ; +}; diff --git a/boards/shields/charybdis/charybdis_right.conf b/boards/shields/charybdis/charybdis_right.conf new file mode 100644 index 0000000..e07661f --- /dev/null +++ b/boards/shields/charybdis/charybdis_right.conf @@ -0,0 +1,18 @@ +CONFIG_SPI=y +CONFIG_INPUT=y +CONFIG_PMW3610=y +CONFIG_ZMK_POINTING=y +CONFIG_ZMK_EXT_POWER=y + +CONFIG_PMW3610_SWAP_XY=y +CONFIG_PMW3610_INVERT_X=y +CONFIG_PMW3610_INVERT_Y=y + +CONFIG_PMW3610_REST1_SAMPLE_TIME_MS=20 +CONFIG_PMW3610_REST2_SAMPLE_TIME_MS=200 +CONFIG_PMW3610_REST3_SAMPLE_TIME_MS=300 +CONFIG_PMW3610_RUN_DOWNSHIFT_TIME_MS=500 +CONFIG_PMW3610_REST1_DOWNSHIFT_TIME_MS=3000 +CONFIG_PMW3610_REST2_DOWNSHIFT_TIME_MS=30000 + +CONFIG_PMW3610_SMART_ALGORITHM=y diff --git a/boards/shields/charybdis/charybdis_right.overlay b/boards/shields/charybdis/charybdis_right.overlay new file mode 100644 index 0000000..33ea0d8 --- /dev/null +++ b/boards/shields/charybdis/charybdis_right.overlay @@ -0,0 +1,35 @@ +#include "charybdis.dtsi" +#include "charybdis_3610.dtsi" +#include "split_input_common.dtsi" + +&default_transform { + col-offset = <6>; +}; + +&five_column_transform { + col-offset = <5>; +}; + +&kscan0 { + compatible = "zmk,kscan-gpio-matrix"; + + col-gpios + = <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 10 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + + row-gpios + = <&pro_micro 18 GPIO_ACTIVE_HIGH> + , <&pro_micro 5 GPIO_ACTIVE_HIGH> + , <&pro_micro 4 GPIO_ACTIVE_HIGH> + , <&pro_micro 9 GPIO_ACTIVE_HIGH> + ; +}; + +&trackball_split { + device = <&trackball>; +}; diff --git a/boards/shields/charybdis/split_input_common.dtsi b/boards/shields/charybdis/split_input_common.dtsi new file mode 100644 index 0000000..dd39969 --- /dev/null +++ b/boards/shields/charybdis/split_input_common.dtsi @@ -0,0 +1,50 @@ +#include +#include + +#define DEF 0 +#define MOUSE 1 +#define SYM 2 +#define NUM 3 +#define FN 4 +#define GENSHIN 5 + +/ { + split_inputs { + #address-cells = <1>; + #size-cells = <0>; + + trackball_split: trackball_split@0 { + compatible = "zmk,input-split"; + reg = <0>; + }; + }; + + trackball_listener: trackball_listener { + compatible = "zmk,input-listener"; + status = "disabled"; + device = <&trackball_split>; + + snipe { + layers = ; + input-processors = <&zip_xy_scaler 1 3>; + }; + + scroll { + layers = ; + input-processors = <&zip_xy_transform (INPUT_TRANSFORM_Y_INVERT)>, <&zip_xy_scaler 1 3>, <&zip_xy_to_scroll_mapper>; + }; + + move { + layers = ; + input-processors = <&auto_mouse_layer MOUSE 5000>; + }; + }; + + auto_mouse_layer: auto_mouse_layer { + compatible = "zmk,input-processor-temp-layer"; + #input-processor-cells = <2>; + require-prior-idle-ms = <500>; + excluded-positions = <30 31 32 16 17 18 10 11 12 13 22 23>; + }; +}; + diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..ff2eafc --- /dev/null +++ b/build.yaml @@ -0,0 +1,46 @@ +# This file generates the GitHub Actions matrix. +# For simple board + shield combinations, add them to the top level board and +# shield arrays, for more control, add individual board + shield combinations +# to the `include` property. You can also use the `cmake-args` property to +# pass flags to the build command and `artifact-name` to assign a name to +# distinguish build outputs from each other: +# +# board: [ "nice_nano_v2" ] +# shield: [ "corne_left", "corne_right" ] +# include: +# - board: bdn9_rev2 +# - board: nice_nano_v2 +# shield: reviung41 +# - board: nice_nano_v2 +# shield: corne_left +# cmake-args: -DCONFIG_ZMK_USB_LOGGING=y +# artifact-name: corne_left_with_logging +# +--- +include: + - board: nice_nano_v2 + shield: charybdis_dongle + snippet: studio-rpc-usb-uart + cmake-args: -DCONFIG_ZMK_STUDIO=y + - board: seeeduino_xiao_ble + shield: charybdis_dongle prospector_adapter + snippet: studio-rpc-usb-uart + cmake-args: -DCONFIG_ZMK_STUDIO=y + + - board: seeeduino_xiao_ble + shield: settings_reset + - board: nice_nano_v2 + shield: settings_reset + + - board: nice_nano_v2 + shield: charybdis_left + - board: nice_nano_v2 + shield: charybdis_right + + - board: nice_nano_v2 + shield: corne_left + snippet: studio-rpc-usb-uart + cmake-args: -DCONFIG_ZMK_STUDIO=y + - board: nice_nano_v2 + shield: corne_right + diff --git a/config/charybdis.conf b/config/charybdis.conf new file mode 100644 index 0000000..82ae330 --- /dev/null +++ b/config/charybdis.conf @@ -0,0 +1,2 @@ +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y +CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y diff --git a/config/charybdis.json b/config/charybdis.json new file mode 100644 index 0000000..24851cb --- /dev/null +++ b/config/charybdis.json @@ -0,0 +1,98 @@ +{ + "url": "https://github.com/Bastardkb/Charybdis/", + "layouts": { + "default_transform": { + "name": "default_transform", + "layout": [ + { "row": 0, "col": 0, "x": 0, "y": 0.575 }, + { "row": 0, "col": 1, "x": 1, "y": 0.575 }, + { "row": 0, "col": 2, "x": 2, "y": 0.125 }, + { "row": 0, "col": 3, "x": 3, "y": 0 }, + { "row": 0, "col": 4, "x": 4, "y": 0.125 }, + { "row": 0, "col": 5, "x": 5, "y": 0.125 }, + { "row": 0, "col": 7, "x": 9, "y": 0.125 }, + { "row": 0, "col": 8, "x": 10, "y": 0.125 }, + { "row": 0, "col": 9, "x": 11, "y": 0 }, + { "row": 0, "col": 10, "x": 12, "y": 0.125 }, + { "row": 0, "col": 11, "x": 13, "y": 0.575 }, + { "row": 0, "col": 12, "x": 14, "y": 0.575 }, + + { "row": 1, "col": 0, "x": 0, "y": 1.575 }, + { "row": 1, "col": 1, "x": 1, "y": 1.575 }, + { "row": 1, "col": 2, "x": 2, "y": 1.125 }, + { "row": 1, "col": 3, "x": 3, "y": 1 }, + { "row": 1, "col": 4, "x": 4, "y": 1.125 }, + { "row": 1, "col": 5, "x": 5, "y": 1.125 }, + { "row": 1, "col": 7, "x": 9, "y": 1.125 }, + { "row": 1, "col": 8, "x": 10, "y": 1.125 }, + { "row": 1, "col": 9, "x": 11, "y": 1 }, + { "row": 1, "col": 10, "x": 12, "y": 1.125 }, + { "row": 1, "col": 11, "x": 13, "y": 1.575 }, + { "row": 1, "col": 12, "x": 14, "y": 1.575 }, + + { "row": 2, "col": 0, "x": 0, "y": 2.575 }, + { "row": 2, "col": 1, "x": 1, "y": 2.575 }, + { "row": 2, "col": 2, "x": 2, "y": 2.125 }, + { "row": 2, "col": 3, "x": 3, "y": 2 }, + { "row": 2, "col": 4, "x": 4, "y": 2.125 }, + { "row": 2, "col": 5, "x": 5, "y": 2.125 }, + { "row": 2, "col": 7, "x": 9, "y": 2.125 }, + { "row": 2, "col": 8, "x": 10, "y": 2.125 }, + { "row": 2, "col": 9, "x": 11, "y": 2 }, + { "row": 2, "col": 10, "x": 12, "y": 2.125 }, + { "row": 2, "col": 11, "x": 13, "y": 2.575 }, + { "row": 2, "col": 12, "x": 14, "y": 2.575 }, + + { "row": 3, "col": 3, "x": 3.48, "y": 3.125, "r": 0 }, + { "row": 3, "col": 4, "x": 3.48, "y": 3.125, "r": 15, "rx": 3.98, "ry": 7.895 }, + { "row": 3, "col": 5, "x": 3.48, "y": 3.125, "r": 30, "rx": 3.98, "ry": 7.895, "h": 1 }, + { "row": 3, "col": 7, "x": 10.52, "y": 3.125, "r": -30, "rx": 11.02, "ry": 7.895, "h": 1 }, + { "row": 3, "col": 8, "x": 10.52, "y": 3.125, "r": -15, "rx": 11.02, "ry": 7.895 } + ] + }, + "five_column_transform": { + "name": "five_column_transform", + "layout": [ + { "row": 0, "col": 1, "x": 0, "y": 0.575 }, + { "row": 0, "col": 2, "x": 1, "y": 0.125 }, + { "row": 0, "col": 3, "x": 2, "y": 0 }, + { "row": 0, "col": 4, "x": 3, "y": 0.125 }, + { "row": 0, "col": 5, "x": 4, "y": 0.125 }, + { "row": 0, "col": 7, "x": 8, "y": 0.125 }, + { "row": 0, "col": 8, "x": 9, "y": 0.125 }, + { "row": 0, "col": 9, "x": 10, "y": 0 }, + { "row": 0, "col": 10, "x": 11, "y": 0.125 }, + { "row": 0, "col": 11, "x": 12, "y": 0.575 }, + + { "row": 1, "col": 1, "x": 0, "y": 1.575 }, + { "row": 1, "col": 2, "x": 1, "y": 1.125 }, + { "row": 1, "col": 3, "x": 2, "y": 1 }, + { "row": 1, "col": 4, "x": 3, "y": 1.125 }, + { "row": 1, "col": 5, "x": 4, "y": 1.125 }, + { "row": 1, "col": 7, "x": 8, "y": 1.125 }, + { "row": 1, "col": 8, "x": 9, "y": 1.125 }, + { "row": 1, "col": 9, "x": 10, "y": 1 }, + { "row": 1, "col": 10, "x": 11, "y": 1.125 }, + { "row": 1, "col": 11, "x": 12, "y": 1.575 }, + + { "row": 2, "col": 1, "x": 0, "y": 2.575 }, + { "row": 2, "col": 2, "x": 1, "y": 2.125 }, + { "row": 2, "col": 3, "x": 2, "y": 2 }, + { "row": 2, "col": 4, "x": 3, "y": 2.125 }, + { "row": 2, "col": 5, "x": 4, "y": 2.125 }, + { "row": 2, "col": 7, "x": 8, "y": 2.125 }, + { "row": 2, "col": 8, "x": 9, "y": 2.125 }, + { "row": 2, "col": 9, "x": 10, "y": 2 }, + { "row": 2, "col": 10, "x": 11, "y": 2.125 }, + { "row": 2, "col": 11, "x": 12, "y": 2.575 }, + + { "row": 3, "col": 3, "x": 2.48, "y": 3.125, "r": 0 }, + { "row": 3, "col": 4, "x": 2.48, "y": 3.125, "r": 15, "rx": 2.98, "ry": 7.895 }, + { "row": 3, "col": 5, "x": 2.48, "y": 3.125, "r": 30, "rx": 2.98, "ry": 7.895, "h": 1 }, + { "row": 3, "col": 7, "x": 9.52, "y": 3.125, "r": -30, "rx": 10.02, "ry": 7.895, "h": 1 }, + { "row": 3, "col": 8, "x": 9.52, "y": 3.125, "r": -15, "rx": 10.02, "ry": 7.895 } + ] + } + }, + "sensors": [] +} diff --git a/config/charybdis.keymap b/config/charybdis.keymap new file mode 100644 index 0000000..a665e15 --- /dev/null +++ b/config/charybdis.keymap @@ -0,0 +1,230 @@ +#include +#include +#include + +#define BASE 0 +#define MOUSE 1 +#define SYMBOL 2 +#define NUMBER 3 +#define FUNCTION 4 +#define GAME 5 +#define RESET 6 + +#define KEYS_L 0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 +#define KEYS_R 5 6 7 8 9 15 16 17 18 19 25 26 27 28 29 +#define THUMBS 30 31 32 33 34 35 + +&sk { + release-after-ms = <600>; + quick-release; +}; + +&sl { + ignore-modifiers; +}; + +&mt { + flavor = "tap-preferred"; +}; + +< { + flavor = "balanced"; + tapping-term-ms = <200>; + quick-tap-ms = <175>; +}; + +&caps_word { + /delete-property/ ignore-modifiers; +}; + +/ { + behaviors { + hml: hml { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <2000>; + quick-tap-ms = <175>; + require-prior-idle-ms = <250>; + hold-trigger-key-positions = ; + hold-trigger-on-release; + bindings = + <&kp>, + <&kp>; + }; + + hmr: hmr { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <2000>; + quick-tap-ms = <175>; + require-prior-idle-ms = <250>; + hold-trigger-key-positions = ; + hold-trigger-on-release; + bindings = + <&kp>, + <&kp>; + }; + hml_s: hml_s { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <2000>; + quick-tap-ms = <175>; + require-prior-idle-ms = <0>; + hold-trigger-key-positions = ; + hold-trigger-on-release; + bindings = + <&kp>, + <&kp>; + }; + + hmr_s: hmr_s { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <2000>; + quick-tap-ms = <175>; + require-prior-idle-ms = <0>; + hold-trigger-key-positions = ; + hold-trigger-on-release; + bindings = + <&kp>, + <&kp>; + }; + + + smart_shift: smart_shift { + compatible = "zmk,behavior-mod-morph"; + #binding-cells = <0>; + bindings = <&sk LSHIFT>, <&caps_word>; + mods = <(MOD_LSFT)>; + }; + }; + + combos { + compatible = "zmk,combos"; + timeout-ms = <20>; + require-prior-idle-ms = <250>; + + combo_reset_layer_left { + key-positions = <20 24>; + bindings = <&to RESET>; + }; + combo_reset_layer_right { + key-positions = <25 29>; + bindings = <&to RESET>; + }; + combo_reset_central { + key-positions = <32 33>; + bindings = <&bootloader>; + require-prior-idle-ms = <2000>; + }; + combo_normal { + key-positions = <7 8>; + bindings = <&to BASE>; + }; + combo_fn { + key-positions = <27 28>; + bindings = <&sl FUNCTION>; + }; + combo_genshin { + key-positions = <5 9>; + bindings = <&to GAME>; + }; + combo_esc { + key-positions = <1 2>; + bindings = <&kp ESCAPE>; + }; + combo_tab { + key-positions = <2 3>; + bindings = <&kp TAB>; + }; + combo_cdel { + key-positions = <11 12>; + bindings = <&kp LC(BACKSPACE)>; + }; + combo_unlock { + key-positions = <0 4>; + bindings = <&studio_unlock>; + }; + }; + chosen { + zmk,physical-layout = &charybdis_5col_layout; + }; + + keymap { + compatible = "zmk,keymap"; + + Base { + display-name = "Base"; + bindings = < + &kp FSLH &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SEMI + &hml LGUI A &hml LALT R &hml LSHFT S &hml LCTRL T &kp G &kp M &hmr RCTRL N &hmr RSHFT E &hmr RALT I &hmr LGUI O + &kp Z &mt LC(X) X &mt LC(C) C &kp D &mt LC(V) V &kp K &kp H &kp COMMA &kp DOT &kp Q + &mt LGUI ESCAPE &smart_shift < SYMBOL SPACE < NUMBER BACKSPACE &mt LS(LC(LEFT_ALT)) ENTER + >; + }; + + Mouse { + display-name = "Mouse"; + bindings = < + &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &kp LGUI &kp LALT &kp LSHFT &kp LCTRL &trans &trans &mkp MB1 &mkp MB2 &mkp MB3 &trans + &trans &trans &mo 3 &mo 2 &trans &trans &trans &trans &trans &trans + &mkp MB1 &mkp MB2 &mkp MB3 &trans &trans + >; + }; + + Sym { + display-name = "Symbol"; + bindings = < + &none &none &kp LEFT_BRACE &kp RIGHT_BRACE &kp PIPE &kp GRAVE &kp TILDE &kp LESS_THAN &kp GREATER_THAN &kp BACKSLASH + &none &none &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp COLON &kp PLUS &kp MINUS &kp SLASH &kp ASTRK &kp SINGLE_QUOTE + &none &none &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp QUESTION &kp AMPS &kp EQUAL &kp UNDER &kp PERIOD &kp DOUBLE_QUOTES + &none &none &trans &none &none + >; + }; + + Num { + display-name = "Number"; + bindings = < + &none &kp N7 &kp N8 &kp N9 &none &none &kp PG_UP &kp UP &kp PG_DN &none + &kp LGUI &hml_s LALT N4 &hml_s LSHFT N5 &hml_s LCTRL N6 &none &none &hmr_s RCTRL LEFT &hmr_s RSHFT DOWN &hmr_s RALT RIGHT &kp RGUI + &none &kp N1 &kp N2 &kp N3 &kp LC(MINUS) &kp LC(EQUAL) &kp HOME &trans &kp END &none + &kp DOT &kp N0 &kp SPACE &trans &none + >; + }; + + Fun { + display-name = "Function"; + bindings = < + &kp LC(LA(DEL)) &kp F7 &kp F8 &kp F9 &kp F10 &none &none &none &none &none + &none &kp F4 &kp F5 &kp F6 &kp F11 &none &kp LCTRL &kp LSHFT &kp LALT &kp LGUI + &none &kp F1 &kp F2 &kp F3 &kp F12 &none &none &none &none &none + &none &none &none &none &none + >; + }; + + Button { + display-name = "Game"; + bindings = < + &kp ESCAPE &kp Q &kp W &kp E &kp R &none &none &none &none &none + &kp LCTRL &kp A &kp S &kp D &kp F &none &mkp MB1 &mkp MB2 &mkp MB3 &none + &kp LSHIFT &kp Z &kp X &kp C &kp V &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 + &kp LALT &kp SPACE &kp M &kp T &kp B + >; + }; + + Reset { + display-name = "Reset"; + bindings = < + &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none + &none &none &none &none &none &none &none &none &none &none + &none &none &bootloader &bootloader &none + >; + }; + }; +}; diff --git a/config/corne.conf b/config/corne.conf new file mode 100644 index 0000000..5a6672b --- /dev/null +++ b/config/corne.conf @@ -0,0 +1,12 @@ +# Mouse config, requires PR #778 +CONFIG_ZMK_POINTING=y + +# Combo config, automated by build script +CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=6 +CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=4 + +# Windows battery reporting fix +CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y +CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y + +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y diff --git a/config/corne.json b/config/corne.json new file mode 100644 index 0000000..098b3b0 --- /dev/null +++ b/config/corne.json @@ -0,0 +1,101 @@ +{ + "id": "corne", + "name": "Corne", + "layouts": { + "default_transform": { + "name": "default_transform", + "layout": [ + { "row": 0, "col": 0, "x": 0, "y": 0.375 }, + { "row": 0, "col": 1, "x": 1, "y": 0.375 }, + { "row": 0, "col": 2, "x": 2, "y": 0.125 }, + { "row": 0, "col": 3, "x": 3, "y": 0 }, + { "row": 0, "col": 4, "x": 4, "y": 0.125 }, + { "row": 0, "col": 5, "x": 5, "y": 0.25 }, + { "row": 0, "col": 7, "x": 9, "y": 0.25 }, + { "row": 0, "col": 8, "x": 10, "y": 0.125 }, + { "row": 0, "col": 9, "x": 11, "y": 0 }, + { "row": 0, "col": 10, "x": 12, "y": 0.125 }, + { "row": 0, "col": 11, "x": 13, "y": 0.375 }, + { "row": 0, "col": 12, "x": 14, "y": 0.375 }, + + { "row": 1, "col": 0, "x": 0, "y": 1.375 }, + { "row": 1, "col": 1, "x": 1, "y": 1.375 }, + { "row": 1, "col": 2, "x": 2, "y": 1.125 }, + { "row": 1, "col": 3, "x": 3, "y": 1 }, + { "row": 1, "col": 4, "x": 4, "y": 1.125 }, + { "row": 1, "col": 5, "x": 5, "y": 1.25 }, + { "row": 1, "col": 7, "x": 9, "y": 1.25 }, + { "row": 1, "col": 8, "x": 10, "y": 1.125 }, + { "row": 1, "col": 9, "x": 11, "y": 1 }, + { "row": 1, "col": 10, "x": 12, "y": 1.125 }, + { "row": 1, "col": 11, "x": 13, "y": 1.375 }, + { "row": 1, "col": 12, "x": 14, "y": 1.375 }, + + { "row": 2, "col": 0, "x": 0, "y": 2.375 }, + { "row": 2, "col": 1, "x": 1, "y": 2.375 }, + { "row": 2, "col": 2, "x": 2, "y": 2.125 }, + { "row": 2, "col": 3, "x": 3, "y": 2 }, + { "row": 2, "col": 4, "x": 4, "y": 2.125 }, + { "row": 2, "col": 5, "x": 5, "y": 2.25 }, + { "row": 2, "col": 7, "x": 9, "y": 2.25 }, + { "row": 2, "col": 8, "x": 10, "y": 2.125 }, + { "row": 2, "col": 9, "x": 11, "y": 2 }, + { "row": 2, "col": 10, "x": 12, "y": 2.125 }, + { "row": 2, "col": 11, "x": 13, "y": 2.375 }, + { "row": 2, "col": 12, "x": 14, "y": 2.375 }, + + { "row": 3, "col": 3, "x": 3.48, "y": 3.125, "r": 0 }, + { "row": 3, "col": 4, "x": 3.48, "y": 3.125, "r": 15, "rx": 3.98, "ry": 7.895 }, + { "row": 3, "col": 5, "x": 3.48, "y": 2.625, "r": 30, "rx": 3.98, "ry": 7.895, "h": 1.5 }, + { "row": 3, "col": 7, "x": 10.52, "y": 2.625, "r": -30, "rx": 11.02, "ry": 7.895, "h": 1.5 }, + { "row": 3, "col": 8, "x": 10.52, "y": 3.125, "r": -15, "rx": 11.02, "ry": 7.895 }, + { "row": 3, "col": 9, "x": 10.52, "y": 3.125 } + ] + }, + "five_column_transform": { + "name": "five_column_transform", + "layout": [ + { "row": 0, "col": 1, "x": 0, "y": 0.375 }, + { "row": 0, "col": 2, "x": 1, "y": 0.125 }, + { "row": 0, "col": 3, "x": 2, "y": 0 }, + { "row": 0, "col": 4, "x": 3, "y": 0.125 }, + { "row": 0, "col": 5, "x": 4, "y": 0.25 }, + { "row": 0, "col": 7, "x": 8, "y": 0.25 }, + { "row": 0, "col": 8, "x": 9, "y": 0.125 }, + { "row": 0, "col": 9, "x": 10, "y": 0 }, + { "row": 0, "col": 10, "x": 11, "y": 0.125 }, + { "row": 0, "col": 11, "x": 12, "y": 0.375 }, + + { "row": 1, "col": 1, "x": 0, "y": 1.375 }, + { "row": 1, "col": 2, "x": 1, "y": 1.125 }, + { "row": 1, "col": 3, "x": 2, "y": 1 }, + { "row": 1, "col": 4, "x": 3, "y": 1.125 }, + { "row": 1, "col": 5, "x": 4, "y": 1.25 }, + { "row": 1, "col": 7, "x": 8, "y": 1.25 }, + { "row": 1, "col": 8, "x": 9, "y": 1.125 }, + { "row": 1, "col": 9, "x": 10, "y": 1 }, + { "row": 1, "col": 10, "x": 11, "y": 1.125 }, + { "row": 1, "col": 11, "x": 12, "y": 1.375 }, + + { "row": 2, "col": 1, "x": 0, "y": 2.375 }, + { "row": 2, "col": 2, "x": 1, "y": 2.125 }, + { "row": 2, "col": 3, "x": 2, "y": 2 }, + { "row": 2, "col": 4, "x": 3, "y": 2.125 }, + { "row": 2, "col": 5, "x": 4, "y": 2.25 }, + { "row": 2, "col": 7, "x": 8, "y": 2.25 }, + { "row": 2, "col": 8, "x": 9, "y": 2.125 }, + { "row": 2, "col": 9, "x": 10, "y": 2 }, + { "row": 2, "col": 10, "x": 11, "y": 2.125 }, + { "row": 2, "col": 11, "x": 12, "y": 2.375 }, + + { "row": 3, "col": 3, "x": 2.48, "y": 3.125, "r": 0 }, + { "row": 3, "col": 4, "x": 2.48, "y": 3.125, "r": 15, "rx": 2.98, "ry": 7.895 }, + { "row": 3, "col": 5, "x": 2.48, "y": 2.625, "r": 30, "rx": 2.98, "ry": 7.895, "h": 1.5 }, + { "row": 3, "col": 7, "x": 9.52, "y": 2.625, "r": -30, "rx": 10.02, "ry": 7.895, "h": 1.5 }, + { "row": 3, "col": 8, "x": 9.52, "y": 3.125, "r": -15, "rx": 10.02, "ry": 7.895 }, + { "row": 3, "col": 9, "x": 9.52, "y": 3.125 } + ] + } + }, + "sensors": [] +} diff --git a/config/corne.keymap b/config/corne.keymap new file mode 100644 index 0000000..6eecab5 --- /dev/null +++ b/config/corne.keymap @@ -0,0 +1,272 @@ +#include +#include +#include +#include +#include + +#define DEF 0 +#define SYM 1 +#define NUM 2 +#define FN 3 + +#define KEYS_L 0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 +#define KEYS_R 5 6 7 8 9 15 16 17 18 19 25 26 27 28 29 +#define THUMBS 30 31 32 33 34 35 36 + +&sk { + release-after-ms = <600>; + quick-release; +}; + +&sl { ignore-modifiers; }; + +&mt { flavor = "tap-preferred"; }; + +&mmv { time-to-max-speed-ms = <1500>; }; + +&msc { time-to-max-speed-ms = <5000>; }; + +/ { + chosen { zmk,physical-layout = &foostan_corne_5col_layout; }; + + combos { + compatible = "zmk,combos"; + combo_normal { + timeout-ms = <20>; + key-positions = <7 8>; + bindings = <&to DEF>; + }; + + combo_fn { + timeout-ms = <20>; + key-positions = <27 28>; + bindings = <&sl FN>; + }; + combo_esc { + timeout-ms = <20>; + key-positions = <1 2>; + bindings = <&kp ESCAPE>; + }; + combo_tab { + timeout-ms = <20>; + key-positions = <2 3>; + bindings = <&kp TAB>; + }; + combo_cdel { + timeout-ms = <20>; + key-positions = <11 12>; + bindings = <&kp LC(BACKSPACE)>; + }; + combo_unlock { + timeout-ms = <20>; + key-positions = <0 4>; + bindings = <&studio_unlock>; + }; + combo_reset_left { + timeout-ms = <20>; + key-positions = <20 24>; + bindings = <&sys_reset>; + }; + combo_reset_right { + timeout-ms = <20>; + key-positions = <25 29>; + bindings = <&sys_reset>; + }; + }; + + macros { + cml: cml { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + wait-ms = <0>; + tap-ms = <0>; + bindings = + <¯o_press &mmv MOVE_LEFT &kp RCTRL>, + <¯o_pause_for_release>, + <¯o_release &mmv MOVE_LEFT &kp RCTRL>; + label = "CML"; + }; + + smd: smd { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + wait-ms = <0>; + tap-ms = <0>; + bindings = + <¯o_press &mmv MOVE_DOWN &kp RSHFT>, + <¯o_pause_for_release>, + <¯o_release &mmv MOVE_DOWN &kp RSHFT>; + label = "SMD"; + }; + + amr: amr { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + wait-ms = <0>; + tap-ms = <0>; + bindings = + <¯o_press &mmv MOVE_RIGHT &kp RALT>, + <¯o_pause_for_release>, + <¯o_release &mmv MOVE_RIGHT &kp RALT>; + label = "AMR"; + }; + }; + + behaviors { + hml: hml { + compatible = "zmk,behavior-hold-tap"; + label = "HML"; + bindings = <&kp>, <&kp>; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + require-prior-idle-ms = <250>; + quick-tap-ms = <150>; + hold-trigger-key-positions = ; + hold-trigger-on-release; + }; + + hmr: hmr { + compatible = "zmk,behavior-hold-tap"; + label = "HMR"; + bindings = <&kp>, <&kp>; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + require-prior-idle-ms = <250>; + quick-tap-ms = <150>; + hold-trigger-on-release; + hold-trigger-key-positions = ; + }; + + hml_s: hml_s { + compatible = "zmk,behavior-hold-tap"; + label = "HML"; + bindings = <&kp>, <&kp>; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + require-prior-idle-ms = <0>; + quick-tap-ms = <150>; + hold-trigger-key-positions = ; + hold-trigger-on-release; + }; + + hmr_s: hmr_s { + compatible = "zmk,behavior-hold-tap"; + label = "HMR"; + bindings = <&kp>, <&kp>; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + require-prior-idle-ms = <0>; + quick-tap-ms = <150>; + hold-trigger-on-release; + hold-trigger-key-positions = ; + }; + + + hmr_cml: hmr_cml { + compatible = "zmk,behavior-hold-tap"; + label = "HMR_CML"; + bindings = <&cml>, <&kp>; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + require-prior-idle-ms = <250>; + quick-tap-ms = <150>; + hold-trigger-on-release; + hold-trigger-key-positions = ; + }; + + hmr_smd: hmr_smd { + compatible = "zmk,behavior-hold-tap"; + label = "HMR_SMD"; + bindings = <&smd>, <&kp>; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + require-prior-idle-ms = <250>; + quick-tap-ms = <150>; + hold-trigger-on-release; + hold-trigger-key-positions = ; + }; + + hmr_amr: hmr_amr { + compatible = "zmk,behavior-hold-tap"; + label = "HMR_AMR"; + bindings = <&amr>, <&kp>; + #binding-cells = <2>; + flavor = "balanced"; + tapping-term-ms = <280>; + require-prior-idle-ms = <250>; + quick-tap-ms = <150>; + hold-trigger-on-release; + hold-trigger-key-positions = ; + }; + + mt_mouse: mt_mouse { + compatible = "zmk,behavior-hold-tap"; + label = "MT_MOUSE"; + flavor = "tap-preferred"; + bindings = <&mmv>, <&kp>; + #binding-cells = <2>; + tapping-term-ms = <200>; + quick-tap-ms = <150>; + }; + + mt_wheel: mt_wheel { + compatible = "zmk,behavior-hold-tap"; + label = "MT_WHEEL"; + flavor = "tap-preferred"; + bindings = <&msc>, <&kp>; + #binding-cells = <2>; + tapping-term-ms = <200>; + quick-tap-ms = <150>; + }; + + smart_shift: smart_shift { + compatible = "zmk,behavior-mod-morph"; + label = "SMART_SHIFT"; + bindings = <&sk LEFT_SHIFT>, <&caps_word>; + #binding-cells = <0>; + mods = <(MOD_LSFT)>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + base { + bindings = < +&kp FSLH &kp W &kp F &kp P &kp B &mt_wheel SCRL_UP J &mt_wheel SCRL_LEFT L &mt_mouse MOVE_UP U &mt_wheel SCRL_RIGHT Y &kp SEMI +&hml LGUI A &hml LALT R &hml LSHFT S &hml LCTRL T &kp G &mt_wheel SCRL_DOWN M &hmr_cml 0 N &hmr_smd 0 E &hmr_amr 0 I &hmr RIGHT_GUI O +&kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp Q + &mkp LCLK &smart_shift < SYM SPACE < NUM BACKSPACE &mt LS(LC(LEFT_ALT)) ENTER &mkp RCLK + >; + }; + Sym { + bindings = < + &none &none &kp LEFT_BRACE &kp RIGHT_BRACE &kp PIPE &kp GRAVE &kp TILDE &kp LESS_THAN &kp GREATER_THAN &kp BACKSLASH + &none &none &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp COLON &kp PLUS &kp MINUS &kp SLASH &kp ASTRK &kp SINGLE_QUOTE + &none &none &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp QUESTION &kp AMPS &kp EQUAL &kp UNDER &kp PERIOD &kp DOUBLE_QUOTES + &none &none &trans &none &none &none + >; + }; + Num { + bindings = < + &none &kp N7 &kp N8 &kp N9 &none &none &kp PG_UP &kp UP &kp PG_DN &none + &kp LGUI &hml_s LALT N4 &hml_s LSHFT N5 &hml_s LCTRL N6 &none &none &hmr_s RCTRL LEFT &hmr_s RSHFT DOWN &hmr_s RALT RIGHT &kp RGUI + &none &kp N1 &kp N2 &kp N3 &kp LC(MINUS) &kp LC(EQUAL) &kp HOME &trans &kp END &none + &kp DOT &kp N0 &kp SPACE &trans &none &none + >; + }; + Fun { + bindings = < + &kp LC(LA(DEL)) &kp F7 &kp F8 &kp F9 &kp F10 &none &none &none &none &none + &none &kp F4 &kp F5 &kp F6 &kp F11 &none &kp LCTRL &kp LSHFT &kp LALT &kp LGUI + &none &kp F1 &kp F2 &kp F3 &kp F12 &none &none &out OUT_TOG &none &none + &none &none &none &none &none &none + >; + }; + }; +}; diff --git a/config/west.yml b/config/west.yml new file mode 100644 index 0000000..615b8b5 --- /dev/null +++ b/config/west.yml @@ -0,0 +1,21 @@ +manifest: + remotes: + - name: zmkfirmware + url-base: https://github.com/zmkfirmware + - name: badjeff + url-base: https://github.com/badjeff + - name: minhe7735 + url-base: https://github.com/minhe7735 + projects: + - name: zmk + remote: zmkfirmware + revision: main + import: app/west.yml + - name: zmk-pmw3610-driver + remote: badjeff + revision: main + - name: prospector-zmk-module + remote: minhe7735 + revision: reduce-size + self: + path: config diff --git a/zephyr/module.yml b/zephyr/module.yml new file mode 100644 index 0000000..55e6e6f --- /dev/null +++ b/zephyr/module.yml @@ -0,0 +1,4 @@ +name: zmk-config +build: + settings: + board_root: .