Android How to get X and Y pos of Mouse?

I’m trying get the X and Y pos from mouse, but it only works if there is a mouse button down. It doesn’t work with mouse up, it works on PC fine, but not on Android. in Unity it works on Android, but not on SDL?. They must of used SDL on Unity I amuse.

Maybe I’m missing something here, but Android doesn’t have a mouse? When a finger is pressed on a mobile phone it’ll be like a mouse action with the button pressed (so it works on the simulator) but there’s no such thing as a mouse move without a button pressed on a touch sensitive mouse-less device. It can’t know where your finger is hovering over!

You can still connect other inputs into the Android device. Like an Xbox Controller, Keyboard, Mouse.

1 Like

It can, just as it can use an external keyboard (either wired or bluetooth).

I have noticed some anomalies when SDL2 on Android is used with a keyboard, so I wouldn’t be too surprised if it misbehaves with a mouse as well.

Yup, certain keys cause crash’s.