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

SDL3: SDL_MouseMotionEvent and SDL_MouseButtonEvent not reporting a valid SDL_MouseId. #11259

Open
Oliver-makes-code opened this issue Oct 18, 2024 · 5 comments
Milestone

Comments

@Oliver-makes-code
Copy link

I'm setting up an input handler for my game engine, and I'm setting it up to support different devices (for local multiplayer), and the events SDL_MouseButtonEvent and SDL_MouseMotionEvent are returning 0 for .which. SDL_MouseWheelEvent is unaffected.

Here's the debug log output from my engine:

main: [DEBUG] SDL event: 1024
main: [WARN] Failed to find Rendering::Input::Mouse device with index 0
main: [DEBUG] SDL event: 1025
main: [WARN] Failed to find Rendering::Input::Mouse device with index 0
main: [DEBUG] SDL event: 1026
main: [WARN] Failed to find Rendering::Input::Mouse device with index 0

I made sure I was on the latest commit from the main branch before reporting.

@AntTheAlchemist
Copy link
Contributor

I'm getting the same. It's been this way for as long as I remember. I just assumed the ID wasn't available. I'd be interested in this working.

@AntTheAlchemist
Copy link
Contributor

Oddly, I get a correct ID when in relative mode.

@slouken
Copy link
Collaborator

slouken commented Oct 18, 2024

I'm not sure where best to document it, but the mouse ID is only available in relative mode on desktop platforms.

@slouken slouken added this to the 3.2.0 milestone Oct 18, 2024
@Oliver-makes-code
Copy link
Author

I'm not sure where best to document it, but the mouse ID is only available in relative mode on desktop platforms.

Could there be a hint to treat it as an arbitrary ID?
SDL_SetHint(SDL_HINT_GLOBAL_MOUSE_ID, "1");

@slouken
Copy link
Collaborator

slouken commented Oct 18, 2024

Or you can just treat mouse ID 0 as your default mouse?

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

No branches or pull requests

3 participants