britzl / defold-input

Simplify input related operations such as gesture detection, input mapping and clicking/dragging game objects
MIT License
111 stars 26 forks source link

Enabling multitouch breaks onscreen analog controls on HTML5 builds running in iOS Safari #33

Closed Makoren closed 1 year ago

Makoren commented 1 year ago

The analog control in the onscreen demo doesn't work when multitouch is enabled. Disabling it by creating a new input binding resource with just a Button 1 mouse event called "touch" and nothing else will cause the analog control to start working again like intended. But this means multitouch can't be used.

I've tested the onscreen demo with multitouch enabled on macOS Chrome, macOS Safari, and Android Chrome, which all work fine. It's only iOS browsers that seem to have this issue. Other multitouch enabled demos also work fine on iOS, like the "gesture" demo.

aglitchman commented 1 year ago

👍🏻 I agree, the problem exists.

The reason is that iOS uses random numbers as touch identificators, but onscreen.lua expects touch ids starting from 0.