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

x52d: a single scroll event may result in multiple REL_WHEEL reports #46

Open
nirenjan opened this issue Jun 14, 2022 · 3 comments
Open

Comments

@nirenjan
Copy link
Owner

Observed behavior
With some hardware, the joystick may report multiple events with the wheel button selected. As a result, x52d receives multiple events where the scroll button is on, but with different values in the axis reports. The following log reported by @VorpalBlade in #45 has some sample events: scrolling.log.

x52d currently only looks at the current state of the scroll buttons, therefore, faulty hardware could result in several virtual wheel events sent to the uinput node for a single scroll event on the joystick wheel.

Expected behavior
Each scroll event from the joystick should result in only 1 scroll event on the virtual mouse.

@stale
Copy link

stale bot commented Dec 16, 2022

This issue has been automatically marked as stale because it has not had recent activity in the past 6 months. It will be closed within 2 weeks if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Stale issue label Dec 16, 2022
@VorpalBlade
Copy link

As far as I know this issue persists. I haven't used my x52 since then (I have not had any time for flight sims in recent months). As such I don't remember, did you need anything further from me?

@stale stale bot removed the stale Stale issue label Dec 16, 2022
@nirenjan nirenjan added the pinned label Feb 6, 2023
nirenjan added a commit that referenced this issue Mar 18, 2023
Prior to this change, the x52d virtual mouse logic was assuming that the
joystick would only send one report with the wheel button state as "on",
and subsequent reports would be "off". However, with some joysticks, the
other axis sensors could be faulty or noisy, and the joystick could send
multiple reports with the mouse button "on", without an "off" state in
between. This was causing scroll events to be much faster than would be
expected (1 mouse scroll to 1 screen scroll event)

This change should fix the problem, by comparing the value of the
previous button state. This should now trigger a wheel event only on a
rising edge (from "off" to "on").

See #46
@nirenjan
Copy link
Owner Author

@VorpalBlade , can you give the changes in the fix-multiple-scroll-events branch a try? I'm hoping that this should fix the issue you were seeing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants