What's the recommended way to disable touchscreen input on Android?

Godot Version

4.4.1

I don’t want any touchscreen input for my game on mobile. What’s the best way to achieve this?

Surely if you don’t collect and respond to any input touch events then that is the same thing is it not?

That wouldn’t work because UI nodes such as Buttons will respond to touch input by default.

Out of curiosity, how do you plan to do input? Bluetooth controller?

So you have buttons on your mobile game, but you don’t want people to touch them? I am not sure I understand.

You could overlay a control node over the entire screen that absorbs all the inputs and sets as handled all the touch inputs perhaps.

I am not really sure I understand the situation or scenario very well, sorry.

I imagined something like marble run, where you control the marble by rolling your phone around and the marble acts like you are making slopes for it to roll down. But you wouldn’t have buttons on the screen to be touched if you did that.

A controller will be required to play, even on mobile devices.

My advice would be, leave touch input intact; if the game is mostly controller driven, but someone wants to poke a UI button with a mouse or their finger, why not let them?

If you really don’t want anyone using touch, @pauldrewett 's technique of making a full-screen invisible input sponge is probably your best bet, unless you want to do a custom build of Godot that removes touch input entirely.

1 Like

Thanks. I found a setting ‘Emulate Mouse from Touch’ in Project Settings > Input Devices > Pointing. I disabled it and at least for my initial testing, it seems to work how I want it to.
I’m not sure if this is the best way, but I will report back if I have any issues or find a more appropriate solution.

2 Likes