summaryrefslogtreecommitdiff
path: root/config/includes/mouse_tp.dtsi
diff options
context:
space:
mode:
authorjakobst1n <jakob.stendahl@outlook.com>2024-01-27 00:17:50 +0100
committerjakobst1n <jakob.stendahl@outlook.com>2024-01-27 01:08:56 +0100
commitfa935f17408d7373b9419bf19b9cecc48f363765 (patch)
tree8c8ac112bf0087debd90d844adb6c41e9cf60e31 /config/includes/mouse_tp.dtsi
parent20c10e8ed1d3710cb83367ca18202e7f160f2506 (diff)
downloadzmk-config-fa935f17408d7373b9419bf19b9cecc48f363765.tar.gz
zmk-config-fa935f17408d7373b9419bf19b9cecc48f363765.zip
ps2
Diffstat (limited to 'config/includes/mouse_tp.dtsi')
-rw-r--r--config/includes/mouse_tp.dtsi142
1 files changed, 142 insertions, 0 deletions
diff --git a/config/includes/mouse_tp.dtsi b/config/includes/mouse_tp.dtsi
new file mode 100644
index 0000000..52856ca
--- /dev/null
+++ b/config/includes/mouse_tp.dtsi
@@ -0,0 +1,142 @@
+#ifdef HAS_MOUSE_TP
+ #include <dt-bindings/zmk/mouse_settings.h>
+
+ /*
+ * Key Behaviors to adjust settings
+ */
+
+ // They key codes below can be used to adjust the TP settings at runtime
+ // without needing to recompile the firmware.
+ //
+ // The values will be logged and saved in the config on the controller flash
+ // after 60s (CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE).
+ //
+ // On boot the settings will be restored again.
+ //
+ // If you prefer a more explicit way of configuration, you can also hardcode
+ // these settings in `&mouse_ps2`.
+ //
+ // If you set these settings in `&mouse_ps2`, you will still be able to
+ // adjust the values during runtime with these key codes, but after
+ // restarting the board the values in `&mouse_ps2` will be restored and not
+ // the ones stored in the flash using the key codes.
+
+
+ // How sensitive the trackpoint is
+ #define U_MSS_TP_S_I &mms MS_TP_SENSITIVITY_INCR
+ #define U_MSS_TP_S_D &mms MS_TP_SENSITIVITY_DECR
+
+
+ // The maximum speed the trackpoint will accelerate to
+ #define U_MSS_TP_V6_I &mms MS_TP_VALUE6_INCR
+ #define U_MSS_TP_V6_D &mms MS_TP_VALUE6_DECR
+
+
+ // I am not quite sure tbh... default seems fine.
+ #define U_MSS_TP_NI_I &mms MS_TP_NEG_INERTIA_INCR
+ #define U_MSS_TP_NI_D &mms MS_TP_NEG_INERTIA_DECR
+
+
+ // How hard you have to press to activate the "Press To Select" feature that
+ // lets you tap or press on the trackpoint to click.
+ //
+ // Not all trackpoints support it and you have to enable
+ // `tp-press-to-select;` in `&mouse_ps2` first.
+ #define U_MSS_TP_PT_I &mms MS_TP_PTS_THRESHOLD_INCR
+ #define U_MSS_TP_PT_D &mms MS_TP_PTS_THRESHOLD_DECR
+
+
+ // If you mess up the settings, you can use this key code to clear the
+ // settings from flash and re-set the default values on the TP.
+ //
+ // Make sure to wait at least CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE seconds (60
+ // by default) before restarting the board to ensure the settings are
+ // written to flash storage.
+ #define U_MSS_RESET &mms MS_RESET
+
+
+ // If you prefer to set the settings in `&mouse_ps2`, you can use the key
+ // codes above to find the settings you like the most and then press this
+ // key code to output the settings to the log.
+ //
+ // Then you can add those values to `&mouse_ps2`
+ #define U_MSS_LOG &mms MS_LOG
+
+
+ /*
+ * Driver-specific configuration
+ */
+
+ &mouse_ps2 {
+ // Enables scroll wheel on mouse devices supporting the Intellimouse
+ // extension.
+ // scroll-mode;
+
+
+ // Disables clicking. Useful when using a PS2 driver that is prone to
+ // erros in transmissions to reduce accidental clicks.
+ // disable-clicking;
+
+ // The frequency at which the mouse samples and sends data (in hz).
+ // The default rate is 100. You can try lowering it if you experience
+ // connection errors.
+ //
+ // Higher values than 100 are no improvement in my experience, but will
+ // increase battery life and potentially errors in transmissions.
+ //
+ // These values are allowed: 10,20,40,60,80,100,200
+ // sampling-rate = <60>;
+
+
+ // Enable clicking by tapping on the TP. Not all TPs support this.
+ // tp-press-to-select;
+ // tp-press-to-select-threshold = <10>;
+
+
+ // How sensitive the TP is (Default: 128)
+ tp-sensitivity = <135>;
+
+
+ // The maximum mouse movement speed the TP will accelarate to (Default: 97)
+ tp-val6-upper-speed = <182>;
+
+
+ // Not quite sure what it does tbh :) (Default: 6)
+ tp-neg-inertia = <6>;
+
+
+ // Adjusts axis settings on the TP
+ // Works only on some trackpoints, but may be properly considered by the
+ // trackpoint's acceleration features (which may or may not have an
+ // impact). Alternatively consider achieving the same effect using the
+ // `zmk,input-configs` feature.
+ // tp-xy-swap;
+ // tp-x-invert;
+ // tp-y-invert;
+
+ };
+
+ /*
+ * Input Config
+ */
+
+ &mouse_ps2_config {
+ xy-swap;
+ x-invert;
+ y-invert;
+
+ // Set the layer that should automatically activate when the mouse is
+ // moving.
+ layer-toggle = <MOUSE_TP>;
+
+ // How long the mouse needs to move for before the layer is activated (to
+ // avoid accidental activations while typing) (Default: 250)
+ layer-toggle-delay-ms = <250>;
+
+ // How long to wait, after the last mouse movement, before deactivating
+ // the layer (Default: 250)
+ layer-toggle-timeout-ms = <250>;
+ };
+
+
+#endif