Mouse and Key input seems to be broken on the web except for Mouse Movement.
You should be able to run the project on Linux, MacOS and Windows using cargo run --release
.
In order to build for wasm32-unknown-unknown
:
- Run
wasm-pack build --target web
( you need a recent version ofwasm-pack
) - Serve the root directory that contains the
Cargo.toml
with a static web server (for example withlive-server
) - Open
index.html
in your browser
Live version can be found here: https://frankenapps.github.io/winit-wasm-events-repro/index.html