I’m trying to develop some common code for macOS and iOS and struggling with detecting if the mouse is supported on the current system. Internally
SDL_GetMouse would be null for iOS, but I can’t find any public API to detect if there is a mouse, and consequently cursors and such.
A simple public
SDL_HasMouse() call would be sufficient for my case. With a trivial body of checking if
SDL_GetMouse returns null or not.
Thanks in advance.
Checking if SDL_GetDefaultCursor() returns a non-null value might work for you.
Thanks! It worked. However, it is relying on a side effect, direct API would be better…
Because touch actions by default get translated into mouse actions (e.g. a tap on the screen generates a left-mouse-click event) I’m not at all sure I’d want a
SDL_HasMouse() function to return FALSE on a touchscreen platform such as Android or iOS. To that extent isn’t the presence or otherwise of a cursor a more direct test of what you are interested in?