+1 vote

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?
in Engine by (24 points)

1 Answer

0 votes

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 :)

by (9,272 points)

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?

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

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.