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

Look ahead buffer to prevent overshoot #2

Open
Glodigit opened this issue Nov 10, 2023 · 0 comments
Open

Look ahead buffer to prevent overshoot #2

Glodigit opened this issue Nov 10, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@Glodigit
Copy link
Owner

Glodigit commented Nov 10, 2023

As the spacemouse is velocity based, there is inertia when it comes to changing direction, meaning that it's easy to overshoot or overcorrect and undershoot a UI target.

A proposed idea is to create a look-ahead buffer of the last 5 complete mouse positions, and the actual mouse position is the oldest element. If the average decerases beond a set limit, stop sending new cursor events.

I say "complete", as 3DxPoint receives X-axis and Y-axis events at different times, but always receives 0 as the last event on that axis. For example, the received values could be:

  • X = 4
  • Y = 12
  • X = 15
  • X = 18
  • Y = 30
  • X = 0
  • Y = 12
  • Y = 4
  • Y = 0

These should be put in the buffer like so: (4, 12) (15, 12) (18, 30) (0, 12) (0, 4) (0, 0). This is also for #1.

@Glodigit Glodigit added the enhancement New feature or request label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant