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

Properly set IsPrecise for SDL scroll events #5236

Merged
merged 1 commit into from Jun 8, 2022

Conversation

Susko3
Copy link
Member

@Susko3 Susko3 commented Jun 7, 2022

Continuation of #5186 (comment).

Tested on a windows precision touchpad, and with a regular mouse.

@peppy
Copy link
Sponsor Member

peppy commented Jun 7, 2022

I guess this method of detection will mean the flag could be incorrect if the first event to arrive is from a precision source but exactly 1.00. Very very unlikely in practice, but just confirming.

@bdach
Copy link
Collaborator

bdach commented Jun 7, 2022

I guess this method of detection will mean the flag could be incorrect if the first event to arrive is from a precision source but exactly 1.00

This was touched on previously. The windows APIs don't seem to be designed to let you know what the scrolling resolution of the device is, they just report back raw values. If you happen to receive a multiple of SCROLL_DELTA, which is supposed to be a 1 notch on a "normal scroll", there looks to be no easy way of knowing if it was "precise" or not.

@Susko3
Copy link
Member Author

Susko3 commented Jun 7, 2022

I guess this method of detection will mean the flag could be incorrect if the first event to arrive is from a precision source but exactly 1.00. Very very unlikely in practice, but just confirming.

Correct, could be false for the first scroll, but I expect the following deltas to be precise.

Also, due to how the debounce is implemented, any scroll within 100 ms of SDL_Init will be considered precise, not worth mentioning as the window is not created/visible in the first 100 ms.

@peppy
Copy link
Sponsor Member

peppy commented Jun 8, 2022

I've tested this on windows and it works as expected (did not test transitioning to mouse from precision, but I think the code is sound enough).

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

Successfully merging this pull request may close these issues.

None yet

3 participants