Multitouch AND mouse menulation for menus

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Wavesonics

I’ve got a project that needs dual on-screen joysticks. For that I of course need multi-touch support.

However, I also have some non-trivial menus in the game, that I would love to not have to duplicate.

For the menu’s to work I need to enabled emulate-mouse-from-touch but for multi-touch on the joysticks I must not have that enabled.

So my question to all of you is this:

  1. Are these assumptions correct?
  2. Assuming they are correct, is there anyway around this catch-22? Could I toggle mouse emulation at run time maybe?
:bust_in_silhouette: Reply From: Calinou

There are methods to get/set the state of touch emulation in InputDefault, but they’re unfortunately not exposed to GDScript. Since the touch emulation project settings are only read at startup, changing its value won’t affect the project.

Feel free to make a pull request to expose those methods to GDScript :slight_smile:

I can definitely submit a PR! But if the setting is only read at startup, it sounds like it wouldn’t help?

Is there a way to force it to be reread?

Wavesonics | 2020-03-31 18:23

There’s no way to do that, so you have to implement methods (and bind them) to expose the touch emulation status to GDScript.

Calinou | 2020-04-08 12:53