Skip to content

Commit

Permalink
feat: pointing merged, update config
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlucachi authored Dec 10, 2024
1 parent 7de6254 commit 86d86f9
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 78 deletions.
10 changes: 10 additions & 0 deletions boards/shields/charybdis/charybdis.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,14 @@
;
};
};

split_inputs {
#address-cells = <1>;
#size-cells = <0>;

trackball_split: trackball_split@0 {
compatible = "zmk,input-split";
reg = <0>;
};
};
};
2 changes: 1 addition & 1 deletion boards/shields/charybdis/charybdis.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/ {
trackball_listener {
compatible = "zmk,input-listener";
device = <&vtrackball>;
device = <&trackball_split>;
};

keymap {
Expand Down
4 changes: 2 additions & 2 deletions boards/shields/charybdis/charybdis_dongle.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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_POINTING=y
CONFIG_ZMK_POINTING_SMOOTH_SCROLLING=y

CONFIG_ZMK_SLEEP=n
12 changes: 0 additions & 12 deletions boards/shields/charybdis/charybdis_dongle.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,4 @@
rows = <0>;
events = <0>;
};
};

/ {
vtrackball: virtual_input_trackball {
compatible = "zmk,virtual-input";
};

input_relay_config_trackball {
compatible = "zmk,split-peripheral-input-relay";
device = <&vtrackball>;
relay-channel = <102>;
};
};
7 changes: 3 additions & 4 deletions boards/shields/charybdis/charybdis_left.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

&kscan0 {
compatible = "zmk,kscan-gpio-matrix";
wakeup-source;

col-gpios
= <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
Expand All @@ -21,8 +22,6 @@
;
};

/ {
vtrackball: virtual_input_trackball {
compatible = "zmk,virtual-input";
};
&trackball_split {
status = "disabled";
};
2 changes: 1 addition & 1 deletion boards/shields/charybdis/charybdis_right.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CONFIG_SPI=y
CONFIG_INPUT=y
CONFIG_PMW3610=y
CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_POINTING=y
CONFIG_ZMK_EXT_POWER=y

CONFIG_PMW3610_INVERT_X=y
Expand Down
13 changes: 3 additions & 10 deletions boards/shields/charybdis/charybdis_right.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,7 @@
status = "okay";
};

/ {
vtrackball: virtual_input_trackball {
compatible = "zmk,virtual-input";
};

input_relay_config_trackball {
compatible = "zmk,split-peripheral-input-relay";
device = <&trackball>;
relay-channel = <102>;
};
&trackball_split {
device = <&trackball>;
input-processors = <&zip_xy_transform (INPUT_TRANSFORM_XY_SWAP | INPUT_TRANSFORM_X_INVERT | INPUT_TRANSFORM_Y_INVERT)>;
};
13 changes: 13 additions & 0 deletions boards/shields/charybdis/charybsid.zmk.yml
Original file line number Diff line number Diff line change
@@ -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_left
- charybdis_right
- charybdis_dongle
46 changes: 5 additions & 41 deletions config/charybdis.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -19,55 +19,19 @@
/ {
trackball_listener {
compatible = "zmk,input-listener";
device = <&vtrackball>;
device = <&trackball_split>;

snipe {
layers = <Button>;
input-processors = <&xy_scaler 1 3>;
layers = <MSE>;
input-processors = <&zip_xy_scaler 1 3>;
};

scroll {
layers = <Nav>;
input-processors = <&xy_invert (INPUT_TRANSFORM_Y_INVERT)>, <&xy_scaler 1 3>, <&x_scaler 0 1>, <&mouse_to_wheel_mapper>;
layers = <NAV>;
input-processors = <&zip_xy_scaler 1 3>, <&zip_xy_to_scroll_mapper>, <&zip_scroll_transform (INPUT_TRANSFORM_Y_INVERT)>;
};
};

xy_scaler: xy_scaler {
compatible = "zmk,input-processor-scaler";
#input-processor-cells = <2>;
type = <INPUT_EV_REL>;
codes = <INPUT_REL_X>, <INPUT_REL_Y>;
};

x_scaler: x_scaler {
compatible = "zmk,input-processor-scaler";
#input-processor-cells = <2>;
type = <INPUT_EV_REL>;
codes = <INPUT_REL_X>;
};

y_scaler: y_scaler {
compatible = "zmk,input-processor-scaler";
#input-processor-cells = <2>;
type = <INPUT_EV_REL>;
codes = <INPUT_REL_Y>;
};

xy_invert: xy_invert {
compatible = "zmk,input-processor-transform";
#input-processor-cells = <1>;
type = <INPUT_EV_REL>;
x-codes = <INPUT_REL_X>, <INPUT_REL_WHEEL>;
y-codes = <INPUT_REL_Y>, <INPUT_REL_HWHEEL>;
};

mouse_to_wheel_mapper: mouse_to_wheel_mapper {
compatible = "zmk,input-processor-code-mapper";
#input-processor-cells = <0>;
type = <INPUT_EV_REL>;
map = <INPUT_REL_X INPUT_REL_MISC>, <INPUT_REL_Y INPUT_REL_WHEEL>;
};

behaviors {
hm: homerow_mods {
compatible = "zmk,behavior-hold-tap";
Expand Down
9 changes: 2 additions & 7 deletions config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@ manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
- name: petejohanson
url-base: https://github.com/petejohanson
- name: badjeff
url-base: https://github.com/badjeff
# 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: petejohanson
revision: feat/pointers-with-input-processors
remote: zmkfirmware
revision: main
import: app/west.yml
- name: zmk-pmw3610-driver
remote: badjeff
revision: main
- name: zmk-split-peripheral-input-relay
remote: badjeff
revision: main
self:
path: config

0 comments on commit 86d86f9

Please sign in to comment.