rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.77k stars 891 forks source link

Extend touchpad magnify and rotate gestures support to Web #2963

Open megaboy101 opened 1 year ago

megaboy101 commented 1 year ago

Hey all,

I recently ran into an issue where I wanted to add two-finger pinch/zoom to a webassembly-compiled Bevy app I was building.

However it looks like magnify and rotate gesture recognition is currently limited to MacOS (#2157).

I'm not too familiar with Winit's internals, but I'd be interested in adding a webassembly implementation to support these gesture events if possible.

daxpedda commented 1 year ago

Hm, I'm not sure we should, it's not supported but we could polyfill it of course. See the MDN documentation on how to polyfill this.

Safari has actually a dedicated API (MDN) for it, which we could definitely implement.

@kchibisov do we intend to polyfill this for other targets too if they don't have official support for it? I saw in #2157 that Wayland and Windows support it, does X11 support it?

kchibisov commented 1 year ago

I think X11 should also support this, it's all coming from the libinput.

daxpedda commented 1 year ago

Alright, let's just go ahead with this then.

@megaboy101 PR's are welcome, I'm happy to review one. Feel free to ping if you need any guidance!