Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jumpy behaviour - Surface Laptop 5 #39

Open
RR-T opened this issue Jan 18, 2024 · 15 comments
Open

Jumpy behaviour - Surface Laptop 5 #39

RR-T opened this issue Jan 18, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@RR-T
Copy link

RR-T commented Jan 18, 2024

Hi,

The app detects the trackpad successfully on the Surface Laptop 5, but moves extremely jerkily/jumpily.

All three-finger gestures are disabled in windows settings. When three-finger gestures are enabled in Windows, they perform smoothly so believe trackpad is functioning correctly.

I am not sure what is expected in the Inputs info screen, but the number of ID: values varies rapidly (see attached screen recording).

In the attached screen recording I am smoothly moving in a large anti-clockwise circle.

Win10 10.0.19045
Latest app release v2.0.1 x64

TFDOW-surface-l-5.mp4
@ClementGre ClementGre added the bug Something isn't working label Feb 19, 2024
@ClementGre
Copy link
Owner

Hi,
There is a good chance that the jumpy behavior is due to the number of inputs that changes, as it should normally not.
Actually, some touchpads are sending fingers coordinates one by one while others send contacts all together.
I changed the code a little bit to try to fix this bug in case you have a touchpad that sends batch inputs.
I will add some logging on the app and release a new version so we will be able to debug the thing in the case it is not fixed by the change I made.

@ClementGre
Copy link
Owner

Hi, I published a new release that allows to record the app logs and to save the log file from the Other settings pane.
Can you update TFDOW and enable the logging. Then, reproduce the jumpy issue your are encountering, stop the logging, and upload the file here please.

Download the v2.0.2 here or on the Microsoft Store.

@metal450
Copy link

Logs_ThreeFingerDragOnWindows.txt

Adding log per #13 (comment)

@ClementGre
Copy link
Owner

I noticed that you dragged with two fingers after some time, and the bug occured when adding back the third finger. Is that really what you did and observed?
On this image (the vertical axis is the time), green corresponds to having three fingers on the touchpad, and blue to two fingers :
TFD

I can’t tell if this is due to your touchpad or due to the way the library I use count contacts. As you see, the drag ends with a two fingers drag that might give a reason for #13.

The reason for the jumpy behavior is that when "you" are adding or removing a finger, the coordinates of one of the two other fingers changes very quickly, and can even sometimes alternate between two values.
Like here with the y coordinate of the contact of ID: 0 (and x too):

[14:29:21.621] Receiving contacts: ID: 0 x,y: 372,279, ID: 1 x,y: 459,63, ID: 2 x,y: 367,355
[14:29:21.621]     MOVING, (x, y) = (-7, 77)
[14:29:21.629] Receiving contacts: ID: 0 x,y: 379,202, ID: 1 x,y: 459,63, ID: 2 x,y: 367,355
[14:29:21.629]     MOVING, (x, y) = (7, -77)
[14:29:21.635] Receiving contacts: ID: 0 x,y: 372,279, ID: 1 x,y: 460,63, ID: 2 x,y: 367,355
[14:29:21.635]     MOVING, (x, y) = (-7, 77)
[14:29:21.643] Receiving contacts: ID: 0 x,y: 381,203, ID: 1 x,y: 460,63, ID: 2 x,y: 368,355
[14:29:21.643]     MOVING, (x, y) = (9, -76)
[14:29:21.650] Receiving contacts: ID: 0 x,y: 374,279, ID: 1 x,y: 460,63, ID: 2 x,y: 368,355
[14:29:21.650]     MOVING, (x, y) = (-7, 76)
etc.

Like #44, the bug is most likely due to the library emoacht/RawInput.Touchpad that I am using to parse the touchpad contacts from the RawInput API (see emoacht/RawInput.Touchpad#1).
I might not be able to fix this issue without editing this piece of code.

@metal450
Copy link

I tried to only drag with 3 fingers, but I'm not 100% certain where the log started and stopped. I certainly didn't go back and forth between 3 finger dragging, 2 finger dragging, 3 finger dragging, 2 finger dragging, though.

Here's one more log, just to be sure. I watched the system clock to ensure that it only includes a 3-finger drag, and nothign else. I removed the bit of the log before and after the actual 3 finger drag. This was a single "place down 3 fingers, drag, release 3 fingers" and nothing else:

Logs_ThreeFingerDragOnWindows.txt

@ClementGre
Copy link
Owner

Well, there is the same issue.
(On the screenshot, horizontal axis is time, three fingers in blue, the rest is to two fingers)
TFD-Dragging

The fact that sometimes only two fingers are detected should not cause any issue, the drag continues as normally, and you can try to remove one finger after having started the drag process (it might change the logs, I'm interested in seing the result of dragging with only two fingers after having started the drag process with three fingers).

But the real issue is that oscillating gestures are reported, leading to a cursor that moves before getting to its original location. I can't find any pattern for when does this happens:

[14:41:02.274] Receiving contacts: ID: 0 x,y: 539,94, ID: 1 x,y: 480,236, ID: 2 x,y: 496,383
[14:41:02.274]     MOVING, (x, y) = (-3, -72)
[14:41:02.280] Receiving contacts: ID: 0 x,y: 540,94, ID: 1 x,y: 486,308, ID: 2 x,y: 496,383
[14:41:02.280]     MOVING, (x, y) = (6, 72)
[14:41:02.288] Receiving contacts: ID: 0 x,y: 540,94, ID: 1 x,y: 483,236, ID: 2 x,y: 499,383
[14:41:02.288]     MOVING, (x, y) = (-3, -72)
[14:41:02.294] Receiving contacts: ID: 0 x,y: 543,94, ID: 1 x,y: 489,309, ID: 2 x,y: 499,383
[14:41:02.294]     MOVING, (x, y) = (6, 73)

It sometimes repeats more than once, and sometimes repeats only once.
A fix for this would be to move the cursor based on a average value over two inputs or more, which will make a latency of over 20ms instead of 10ms. I will add a feature for this in future release, but it would still be more efficient to fix the root of the issue on the emoacht/RawInput.Touchpad code.

@metal450
Copy link

metal450 commented Apr 9, 2024

Here's starting a 3 finger drag, then releasing 1 of the fingers and continuing to drag with 2 fingers

Logs_ThreeFingerDragOnWindows.txt

@ClementGre
Copy link
Owner

Here, there is not any more a wrong count of fingers on the touchpad.
(two fingers in green, three in blue)
TFD-two_fingers

I'll add the support for moving the mouse based on the average of multiple inputs in future releases, plus trying to see if there is a bug in emoacht/RawInput.Touchpad.

@ClementGre
Copy link
Owner

Hi, I added a way to move the cursor based on an average of N inputs.
Can you upgrade to v2.0.4 and try to set the average to 2 inputs or more, it might help to reduce the jumpy behavior.

@RR-T
Copy link
Author

RR-T commented May 8, 2024

Hi, perhaps this made a marginal improvement - Please see attached screen recording again; smooth anti-clockwise circles maintaining 3 fingers on the trackpad; with associated log file.

Video.5-08.At.11.29.mp4

Logs_ThreeFingerDragOnWindows.txt

@metal450
Copy link

I tried raising it as high as 7. It's still pretty much chaos for me. Here's an example:

peek

@ClementGre
Copy link
Owner

Just a shot in the dark, can you try to disable the mouse acceleration and see if it is still jumpy?

@metal450
Copy link

Still jumpy.

Also fwiw, in my specific case there isn't a ton of benefit to debugging/fixing the dragging as it still has the right-click-on-release issue too, which means that even in the cases where it does drag smoothly, when I release the mouse, it doesn't actually lead to a drag - because of the right click. So for my purposes, that issue is even more of a blocker.

@ClementGre
Copy link
Owner

I just released a new version of TFDOW that should fix some bugs regarding the touchpad raw input parsing for touchpads that send reports "sequentially" (editing the code of emoacht/RawInput.Touchpad that I am using).
It might fix your issue.

Can you try again on the v2.0.5 (Microsoft Store).
If you still have issues, you can share again the log file.

@metal450
Copy link

No improvement to either jumping-around behavior, or right click on release behavior

Logs_ThreeFingerDragOnWindows.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants