SDL
SDL copied to clipboard
Android: Relative mouse mode doesn't work on Google Play Games on PC
Atm. I try it on BlueStacks emulator on macOS but it behaves the same. And I'm pretty sure it is possible to make it working because it works fine in Roblox (it hides mouse cursor and FPS camera works fine there).
From what I read in documentation it should be enough to just declare
<manifest ...>
<uses-feature
android:name="android.hardware.type.pc"
android:required="false" />
...
</manifest>
in manifest and I should receive mouse events in generic motion listener (SDL already has generic motion listener). https://developer.android.com/games/playgames/input-mouse
But I can't get these events no matter what. I receive events only in onTouch() and setting relative mouse mode doesn't do anything.
The game works fine with physical mouse on Android phone/tablet or ChromeOS.
Here is the source code but it seems that the problem is somewhere in SDL java activity or maybe android project. https://github.com/deveee/MultiCraft/tree/SDL3/Android https://github.com/deveee/Irrlicht/blob/SDL3/source/Irrlicht/CIrrDeviceSDL.cpp
Btw. if you want to test on BlueStacks, you need enable it in accessibility settings https://support.bluestacks.com/hc/en-us/articles/32611424304781-Solution-for-mouse-related-issues-in-FPS-games-like-Free-Fire-PUBG-Stand-Off-2-COD-M-on-BlueStacks-Air
Any idea?