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 index e974e08..0ea9a02 100644 --- a/boards/shields/charybdis/charybdis.dtsi +++ b/boards/shields/charybdis/charybdis.dtsi @@ -1,9 +1,10 @@ #include +#include / { chosen { zmk,kscan = &kscan0; - zmk,matrix_transform = &default_transform; + zmk,physical-layout = &charybdis_6col_layout; }; default_transform: keymap_transform_0 { @@ -35,4 +36,126 @@ 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..e2bef93 --- /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 + >; + }; + }; +}; \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis_dongle.conf b/boards/shields/charybdis/charybdis_dongle.conf index 44cfece..c087e81 100644 --- a/boards/shields/charybdis/charybdis_dongle.conf +++ b/boards/shields/charybdis/charybdis_dongle.conf @@ -1,6 +1,8 @@ CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2 +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y CONFIG_INPUT=y CONFIG_ZMK_MOUSE=y +CONFIG_ZMK_MOUSE_SMOOTH_SCROLLING=y CONFIG_ZMK_SLEEP=n \ No newline at end of file diff --git a/boards/shields/charybdis/charybdis_left.conf b/boards/shields/charybdis/charybdis_left.conf index e69de29..9ce5b96 100644 --- a/boards/shields/charybdis/charybdis_left.conf +++ 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_right.conf b/boards/shields/charybdis/charybdis_right.conf index e69de29..720e630 100644 --- a/boards/shields/charybdis/charybdis_right.conf +++ b/boards/shields/charybdis/charybdis_right.conf @@ -0,0 +1,14 @@ +CONFIG_SPI=y +CONFIG_INPUT=y +CONFIG_PMW3610=y +CONFIG_ZMK_MOUSE=y +CONFIG_ZMK_EXT_POWER=y + +CONFIG_PMW3610_INVERT_X=y + +CONFIG_PMW3610_REST1_SAMPLE_TIME_MS=100 +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 \ No newline at end of file diff --git a/build.yaml b/build.yaml index 835fd39..fbae8ac 100644 --- a/build.yaml +++ b/build.yaml @@ -20,8 +20,12 @@ include: - board: seeeduino_xiao_ble shield: charybdis_dongle + snippet: studio-rpc-usb-uart + cmake-args: -DCONFIG_ZMK_STUDIO=y - board: nice_nano_v2 shield: charybdis_dongle + snippet: studio-rpc-usb-uart + cmake-args: -DCONFIG_ZMK_STUDIO=y - board: nice_nano_v2 shield: charybdis_left - board: nice_nano_v2 diff --git a/config/charybdis.conf b/config/charybdis.conf index 2e24fb1..ab57e65 100644 --- a/config/charybdis.conf +++ b/config/charybdis.conf @@ -2,16 +2,4 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_8=y CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y -CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y - -#eager debouce -#CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=1 -#CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5 - -#logging -#CONFIG_ZMK_USB_LOGGING=y -#CONFIG_LOG_MODE_IMMEDIATE=n -#CONFIG_LOG_TIMESTAMP_64BIT=y -#CONFIG_LOG_PROCESS_THREAD_STARTUP_DELAY_MS=5000 -#CONFIG_ZMK_LOG_LEVEL_DBG=y -#CONFIG_KSCAN_LOG_LEVEL_INF=y \ No newline at end of file +CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_PROXY=y \ No newline at end of file diff --git a/config/charybdis.keymap b/config/charybdis.keymap index 2247918..5664e77 100644 --- a/config/charybdis.keymap +++ b/config/charybdis.keymap @@ -5,6 +5,8 @@ #include #include +#include + #define Base 0 #define Media 1 #define Nav 2 @@ -16,43 +18,54 @@ / { trackball_listener { - compatible = "zmk,input-behavior-listener"; + compatible = "zmk,input-listener"; device = <&vtrackball>; - layers = <0>; - evt-type = ; - x-input-code = ; - y-input-code = ; - scale-multiplier = <1>; - scale-divisor = <6>; + + snipe { + layers = ; + input-processors = <&xy_scaler 1 3>; + }; + + scroll { + layers =