From 008b2323372e740f72ad43b8968dcec3d5e32f0e Mon Sep 17 00:00:00 2001 From: Kim Streich Date: Sun, 14 Apr 2024 16:06:05 -0600 Subject: [PATCH] Build: Switch to new trackpoint driver module from zmk fork --- .../shields/think_corney/think_corney.dtsi | 2 +- config/think_corney.conf | 41 ++++++++++++++++++- config/think_corney.keymap | 2 +- config/west.yml | 9 +++- 4 files changed, 48 insertions(+), 6 deletions(-) diff --git a/config/boards/shields/think_corney/think_corney.dtsi b/config/boards/shields/think_corney/think_corney.dtsi index 9f6ddd5d..38b883e4 100644 --- a/config/boards/shields/think_corney/think_corney.dtsi +++ b/config/boards/shields/think_corney/think_corney.dtsi @@ -239,7 +239,7 @@ nice_view_spi: &spi0 { }; mouse_ps2_input_listener: mouse_ps2_input_listener { - compatible = "zmk,input-listener"; + compatible = "zmk,input-listener-ps2"; status = "disabled"; device = <&mouse_ps2>; diff --git a/config/think_corney.conf b/config/think_corney.conf index 4c026376..1211352d 100644 --- a/config/think_corney.conf +++ b/config/think_corney.conf @@ -19,13 +19,50 @@ CONFIG_ZMK_SLEEP=y CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 # -# Configure PS2 Mouse Settings +# Configure PS2 Mouse / Trackpoint Driver Settings # +# Enable compatibility with urob's zmk fork: +# https://github.com/urob/zmk +# +# Urob's fork is a popular way to beta test zmk's mouse keys without +# maintaining your own fork. +# +# But some of his additions also introduce changes that make some zmk +# "APIs" incompatible with zmk main and produce compile errors. +# +# Enable this option to make the PS2 mouse driver compatible with his +# fork. +# CONFIG_ZMK_INPUT_MOUSE_PS2_ENABLE_UROB_COMPAT=n + # Enable additional error mitigations to prevent cursor jumps # Disabled by default and only recommended if using the GPIO PS2 driver -# CONFIG_ZMK_INPUT_MOUSE_PS2_ENABLE_ERROR_MITIGATION=n +# CONFIG_ZMK_INPUT_MOUSE_PS2_ENABLE_ERROR_MITIGATION=y +# Enable the PS2 protocol driver to report transmission errors to the mouse +# driver. This way the mouse driver can re-align its command buffer and reduce +# unexpected clicks or mouse movement in cases when the controller can't keep +# up with the data from the mouse or trackpoint. +# +# This setting is not necessary when using the PS2 UART driver, but is very +# helpful for the PS2 GPIO driver, because that driver experiences connection +# errors much more frequently. +# +# But this option requires zmk to be built with a forked zephyr that contains +# the following commit: `drivers: ps2: Add resend callback to ps/2 interface` +# +# You can find it here: +# https://github.com/infused-kim/zmk-zephyr/tree/dev/ps2_resend_callback_only +# +# I won't keep this branch updated, so just cherry pick the commit onto the +# latest zephyr branch zmk uses. +# +# TLDR: You don't need this unless you use the PS2 GPIO driver and you really +# shouldn't use that driver unless the PS2 UART driver doesn't work. And if +# it doesn't work, then it's better to find a solution to that than to use +# this. +# CONFIG_PS2_GPIO_ENABLE_PS2_RESEND_CALLBACK=y +# CONFIG_PS2_UART_ENABLE_PS2_RESEND_CALLBACK=y # # System Settings diff --git a/config/think_corney.keymap b/config/think_corney.keymap index 0188b727..f3e1eeac 100644 --- a/config/think_corney.keymap +++ b/config/think_corney.keymap @@ -6,7 +6,7 @@ #define KEYS_T LH2 LH1 LH0 RH0 RH1 RH2 /* Enable keymap features that require forks */ -#define HAS_UROB +// #define HAS_UROB #define HAS_MOUSE_KEYS #define HAS_MOUSE_TP // #define HAS_CAPSLOCK diff --git a/config/west.yml b/config/west.yml index e935c453..68b94005 100644 --- a/config/west.yml +++ b/config/west.yml @@ -6,10 +6,15 @@ manifest: url-base: https://github.com/urob - name: infused-kim url-base: https://github.com/infused-kim + - name: petejohanson + url-base: https://github.com/petejohanson projects: - name: zmk - remote: infused-kim - revision: pr-testing/mouse_ps2_v2 + remote: petejohanson + revision: petejohanson/feat/pointers-move-scroll import: app/west.yml + - name: kb_zmk_ps2_mouse_trackpoint_driver + remote: infused-kim + revision: main self: path: config