Skip to content

SDL analog mouse input#12612

Merged
hrydgard merged 6 commits intohrydgard:masterfrom
iota97:sdl-mouse
Mar 5, 2020
Merged

SDL analog mouse input#12612
hrydgard merged 6 commits intohrydgard:masterfrom
iota97:sdl-mouse

Conversation

@iota97
Copy link
Copy Markdown
Contributor

@iota97 iota97 commented Feb 4, 2020

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

Comment thread SDL/SDLMain.cpp Outdated
Comment thread SDL/SDLMain.cpp Outdated
@iota97
Copy link
Copy Markdown
Contributor Author

iota97 commented Feb 4, 2020

Fixed

@iota97
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

3 participants