I am writing an app with PySDL2, SDL 2.0.9 and I’m trying to get separate mouse events. This is how my setup code works:
import sdl2 as sdl
loginfo("Setting SDL2 settings")
sdl.SDL_SetHintWithPriority(b"SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH", b"1",
sdl.SDL_HINT_OVERRIDE)
sdl.SDL_SetHintWithPriority(
b"SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH", b"1",
sdl.SDL_HINT_OVERRIDE,
)
sdl.SDL_SetHintWithPriority(b"SDL_ANDROID_TRAP_BACK_BUTTON", b"1",
sdl.SDL_HINT_OVERRIDE)
sdl.SDL_SetHintWithPriority(b"SDL_TIMER_RESOLUTION", b"0",
sdl.SDL_HINT_OVERRIDE)
sdl.SDL_SetHintWithPriority(b"SDL_RENDER_BATCHING", b"1",
sdl.SDL_HINT_OVERRIDE)
sdl.SDL_SetHintWithPriority(
b"SDL_HINT_RENDER_SCALE_QUALITY", b"1",
sdl.SDL_HINT_OVERRIDE)
subsystems = sdl.SDL_WasInit(sdl.SDL_INIT_EVERYTHING)
if not (subsystems & sdl.SDL_INIT_VIDEO):
loginfo("Calling SDL_Init")
sdl.SDL_Init(sdl.SDL_INIT_VIDEO|sdl.SDL_INIT_TIMER)
else:
loginfo("NOT calling SDL_Init, already initialized")
All other hints work perfectly, and I get “Calling SDL_Init” as output so SDL_Init shouldn’t have been called previously. But all mouse events I get on ,y Android 7.1.1 device are still SDL_TOUCH_MOUSEID, and I get no mouse motion when not clicking (as if it was a finger) etc.
So what am I doing wrong? What else do I need to do to get proper hardware mouse events on Android?