Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm: Touch events not received on Android browsers #1286

Closed
icefoxen opened this issue Nov 25, 2019 · 10 comments
Closed

wasm: Touch events not received on Android browsers #1286

icefoxen opened this issue Nov 25, 2019 · 10 comments
Labels
B - bug Dang, that shouldn't have happened C - needs investigation Issue must be confirmed and researched DS - web

Comments

@icefoxen
Copy link
Contributor

icefoxen commented Nov 25, 2019

Particularly Android Firefox. Example: https://alopex.li/temp/g11/ I tap away and it does nothing. Not sure what touch events would be for if not for this.

Android Chrome seems to turn taps into WindowEvent::MouseInput events, but Firefox does not. Not sure how to investigate this further, since I know little about mobile dev and little about webdev and so the Venn diagram of what I know about the two together is vanishingly small.

@ryanisaacg
Copy link
Contributor

Hm, this is something that completely slipped my mind but I already knew about: ryanisaacg/quicksilver#527. This is because Firefox Mobile apparently doesn't support Touch events, though caniuse seems to indicate a recent release does.

Can you share your mobile browser version?

@ryanisaacg ryanisaacg added DS - web C - needs investigation Issue must be confirmed and researched B - bug Dang, that shouldn't have happened labels Nov 25, 2019
@icefoxen
Copy link
Contributor Author

Firefox 68.2.1. Thought it was newer than that actually! Still looks like it should be supported though.

@ryanisaacg
Copy link
Contributor

I whipped up a quick test:

https://jsfiddle.net/au0qxjmo/

Does this print touch events in Firefox? (If it doesn't, I'm curious if it does in Chrome)

@OvermindDL1
Copy link

OvermindDL1 commented Nov 25, 2019

Touch events work in the modern/new Firefox on my android here.
And in Chrome on android.
Doesn't work in the older pre-quantum firefox on android here though.

I used this as the jsfiddle instead though so I didn't have to hook up a console over USB:
https://jsfiddle.net/bxL5qsm7/

@jakmeier
Copy link

Hey I think I might be able to help, with some information.

It looks like you are talking about different events here without noticing. The touch-start events and friends have never been a problem for me on mobile FF, this works fine. The problem with mobile FF is with the pointer-move events and friends. As you can see at canisuse you have to enable these events on FF for Android. (Requires dom.w3c_pointer_events.enabled = true)

The pointer events are supposed to combine mouse and touch events. Ideally, if all browsers implemented them, touch and mouse events could be ignored and only pointer events need to be considered. That's what quicksilver still does as of 0.3.18, I believe. And from skimming through winit code for five minutes I get the impressions it is done the same way.

So in my expertise, you can probably get JS touch events on a mobile FF but these are not propagated by winit.

@alvinhochun
Copy link
Contributor

I believe this issue is now obsolete on master since the web-sys backend supports mouse events as a fallback (and now that the old Firefox is going away). Can this be closed?

@ostwilkens
Copy link

I have been dabbling with touch controls a bit now, through mrk-its/bevy_webgl2.

With a simple css property on the canvas (touch-action: none), the CursorMoved event seems to work fine. Even for multitouch if you use the device_id!

However...
IMHO, as long as winit differentiates between Touch and Mouse events, they should be kept separate.
I assume Touch works on the android/ios platforms. Having to handle touch differently on native android and web android seems... wrong?

@alvinhochun
Copy link
Contributor

See #1673, proper touch events on web is not yet implemented.

From what I understand this issue is about the mouse events synthesized from touch and not actual touch events.

@ostwilkens
Copy link

Ah right, this firefox-specific issue is probably not a problem anymore. I got hung up on the title.

@daxpedda
Copy link
Member

daxpedda commented Jun 2, 2023

I can't try this myself, but touch on Desktop seems to work just fine.
Feel free to reopen if there is still an issue with this.

Fixed by #2188.

@daxpedda daxpedda closed this as completed Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened C - needs investigation Issue must be confirmed and researched DS - web
Development

No branches or pull requests

7 participants