sdl2-compat
sdl2-compat copied to clipboard
Use SDL3's integer mouse mode hint
This reverts https://github.com/libsdl-org/sdl2-compat/pull/378 and uses the new SDL3 integer mouse mode hint from https://github.com/libsdl-org/SDL/pull/12497 (further modified in https://github.com/libsdl-org/SDL/pull/12551) instead.
I also searched GitHub for popular SDL2 apps that support fractional wheel events and preemptively quirked them so they will continue to receive them. Unquirked apps will just receive wheel events when they accumulate to an integer value (preserving compatibility but losing smooth scrolling). We can quirk others if users report loss of smooth scrolling with sdl2-compat.
Fixes #372
We should wait to merge this until we get closer to the next SDL3 release.
This will need to require 3.2.10 at runtime (when it's released)
This will need to require 3.2.10 at runtime (when it's released)
Yep, I'll take care of this when I merge it.
heads-up: https://github.com/libsdl-org/SDL/commit/f52f982b1e9ce2f510f2c26c6119e79dbb5b20a0 slightly changes the behavior of the mode values to behave as a bitflag instead.
Thanks, updated the PR for that change.
OpenTTD relies on both fractional values (for smooth two-finger viewport dragging) and accumulated integer values (for scrolling in menus). Should it be quirked?
OpenTTD relies on both fractional values (for smooth two-finger viewport dragging) and accumulated integer values (for scrolling in menus). Should it be quirked?
Yes, feel free to submit a tested PR.
@slouken I've tried it and can't get both accumulated integer and precise fractional scrolling to work at the same time (default is jumpy 2-finger dragging, SDL_MOUSE_INTEGER_MODE=1 breaks menu scrolling on touchpad). Is it possible to accurately emulate old behavior where accumulation was done for integer but not precise values?