Is the mouse "emulated" on Android?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Zylann
:warning: Old Version Published before Godot 3 was released.

I made a game with custom controls that react to mouse clicks. If I export this game for Android, will my buttons work? Or should I create another “mobile” version for all of them?

Edit: I just tested with an APK export, and it seems to work. But some buttons have weird behaviour, as if the mouse was moveable by dragging, and clickable by tapping. Sometimes other buttons even steal the input…

:bust_in_silhouette: Reply From: volzhs

Make it with SCREEN_TOUCH, SCREEN_DRAG instead of MOUSE_BUTTON, MOUSE_MOTION.
And check emulate_touchscreen on at Project Settings > Display.
Then you don’t need to make another version for different platform.

:bust_in_silhouette: Reply From: kubecz3k

Yes it’s. As long as your program works only with one input (no multitouch), you don’t need to program touch separately. InputEvent.MOUSE_BUTTON and InputEvent.MOUSE_MOTION events will work normally on touch screen device.