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

SDL analog mouse input #12612

Merged
merged 6 commits into from
Mar 5, 2020
Merged

SDL analog mouse input #12612

merged 6 commits into from
Mar 5, 2020

Conversation

iota97
Copy link
Contributor

@iota97 iota97 commented Feb 4, 2020

Add analog mouse input to SDL, adding another platform to #4650.

SDL/SDLMain.cpp Outdated Show resolved Hide resolved
SDL/SDLMain.cpp Outdated Show resolved Hide resolved
@iota97
Copy link
Contributor Author

iota97 commented Feb 4, 2020

Fixed

@iota97
Copy link
Contributor Author

iota97 commented Mar 5, 2020

Sending KEY_UP right after was too fast for any game I tried (was working only on the bind menu), added mouse 3, 4 and 5 press as well to match windows version.

@hrydgard
Copy link
Owner

hrydgard commented Mar 5, 2020

Hm, what if there's not a next cycle? Maybe a timer (frame counter) to send a KEY_UP after a while?

@iota97
Copy link
Contributor Author

iota97 commented Mar 5, 2020

If is in the main loop, while (true), shouldn't there be always another cycle (unless the emulator get closed at least)?

@hrydgard
Copy link
Owner

hrydgard commented Mar 5, 2020

Oh right, for some reason I thought you meant next time you get a mousewheel event.

Never mind, it seems right (but only one frame of down state might not always be enough).

@hrydgard hrydgard added Input/Controller Input and controller issues SDL2 Issue on SDL (or Qt in SDL code) but not all ports. labels Mar 5, 2020
@iota97
Copy link
Contributor Author

iota97 commented Mar 5, 2020

Yeah, made it 5 (may be a bit too much, but it allow to simulate a hold if scrolled fast, still can be reduced)

@hrydgard
Copy link
Owner

hrydgard commented Mar 5, 2020

Yeah, we can tweak that as needed. Let's merge.

@hrydgard hrydgard merged commit 875d53a into hrydgard:master Mar 5, 2020
@iota97 iota97 deleted the sdl-mouse branch March 6, 2020 09:54
@unknownbrackets unknownbrackets added this to the v1.10.0 milestone Jun 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Input/Controller Input and controller issues SDL2 Issue on SDL (or Qt in SDL code) but not all ports.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants