[synaptics] Require minimum finger move before moving cursor (helps with jumps when clicking)
kaycee gb
kisscoolandthegangbang at hotmail.fr
Fri May 3 22:19:47 UTC 2024
Le Fri, 12 Apr 2024 15:29:35 +0200,
kaycee gb <kisscoolandthegangbang at hotmail.fr> a écrit :
> Hi,
>
> I have a "crappy" touchpad on my dell laptop that drives me crazy. I am
> unable to fix the sensitivity/jump problems when clicking. I tried different
> things. Sometimes it seems to help/make the jumps less present but not really
> for a long time.
>
> Thinking about that, I wonder how it would be possible to require a minimal
> finger motion before the cursor can move ? Is it doable ? Coding needed ?
>
> Thanks in advance,
> K.
Hi,
After some playing with the code I was able to fix the jumps I had with my
touchpad. It's like day and knight.
Required some versions to try and fail, some rewrites and after minimification,
it gives something like below.
Values are hardcoded and works ok for my device, they should be configurable
but that was too much work for me compared to patch driver, rebuild package
and reinstall.
****
diff --git a/src/synaptics.c b/src/synaptics.c
index 6f8889b..a899ed6 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -3210,7 +3210,9 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState
*hw, CARD32 now,
/* Post events */
if (finger >= FS_TOUCHED && (dx || dy) && !ignore_motion)
- xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
+ if (abs(priv->touch_on.x - hw->x) > 30 && abs(priv->touch_on.y -
hw->y) > 75 ||
+ abs(priv->touch_on.x - hw->x) > 150 || abs(priv->touch_on.y -
hw->y) > 250 || now - priv->touch_on.millis > 150)
+ xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
if (priv->mid_emu_state == MBE_LEFT_CLICK) {
post_button_click(pInfo, 1);
****
Patch file attached.
Maybe it can be useful for someone else.
Regards,
K.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: synaptics.c-sensitivity_jumps.patch
Type: text/x-patch
Size: 735 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg/attachments/20240504/4eee8658/attachment.bin>
More information about the xorg
mailing list