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

TouchInput events are not working for web builds #4565

Open
asafigan opened this issue Apr 23, 2022 · 5 comments
Open

TouchInput events are not working for web builds #4565

asafigan opened this issue Apr 23, 2022 · 5 comments
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Bug An unexpected or incorrect behavior O-Android Specific to the Android mobile operating system O-Web Specific to web (WASM) builds

Comments

@asafigan
Copy link
Contributor

Bevy version

0.7

Operating system & version

Chrome 100 on Android 12

What you did

Create a sprite following users touch input.

What you expected to happen

To get TouchInput events.

What actually happened

No TouchInput events are being produced.

Additional information

Mouse position changes only at the start of a touch. I would like touch events rather than mouse position because I want to handle multiple fingers at the same time.

@asafigan asafigan added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Apr 23, 2022
@alice-i-cecile alice-i-cecile added A-Input Player input via keyboard, mouse, gamepad, and more O-Web Specific to web (WASM) builds O-Android Specific to the Android mobile operating system and removed S-Needs-Triage This issue needs to be labelled labels Apr 23, 2022
@bit-garden
Copy link

bit-garden commented Jun 15, 2022

This is rooted in winit. rust-windowing/winit#2188 was attempted to merge yesterday, so we should see a fix soon. Hopefully Bevy is ready.

A post here gives a rough example of how to get around this, but looks like it needs some hand rolled JS interop.

The solution I concocted was to implement touch events in JavaScript, collect the touch data and let Rust ‘pop’ the touch events - and then map these events to my input system.

@johanhelsing
Copy link
Contributor

Hopefully Bevy is ready.

I tested it with Bevy 0.7 and it works great for everything I needed :)

@tad-lispy
Copy link

What's the status of this issue? The touch on web platform doesn't seem to be working out of the box in Bevy, but the winit PR is merged and the corresponding issue is closed as fixed. Or is it suppose to work and I'm just doing something wrong in my code?

@mockersf
Copy link
Member

It has been fixed on winit side and updated on main, but it hasn't been released yet.

@james7132
Copy link
Member

Is this fixed now with winit 0.28?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Input Player input via keyboard, mouse, gamepad, and more C-Bug An unexpected or incorrect behavior O-Android Specific to the Android mobile operating system O-Web Specific to web (WASM) builds
Projects
None yet
Development

No branches or pull requests

7 participants