m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
5.95k stars 449 forks source link

Support for mouse capture / pointer lock #344

Open GameParrot opened 8 months ago

GameParrot commented 8 months ago

Would it be possible to add pointer lock support so games that lock the mouse cursor work?

ehfd commented 4 months ago

These are some reference codes that utilize the Pointer Lock API to achieve this.

https://github.com/selkies-project/selkies-gstreamer/tree/main/addons/gst-web/src

https://github.com/kasmtech/noVNC

And this is a way to support gamepads inside a container without needing to use uinput.

https://github.com/selkies-project/selkies-gstreamer/tree/main/addons/js-interposer

With X11, XTEST may be used to send relative mouse events, which is combined with the Pointer Lock API. https://github.com/selkies-project/selkies-gstreamer/blob/b0827470bc1328e1237f93e60ebb5556f0c61c0b/src/selkies_gstreamer/webrtc_input.py#L282

ehfd commented 4 months ago

Relevant for the web interface redesign for #358.

ehfd commented 2 months ago

https://github.com/Xpra-org/xpra/blob/a5a13a993139d9d48a60734e7bab3ec9d53c919a/xpra/server/mixins/input.py#L257

This should be a way to fix continued key presses during congestion and packet losses, instead of using time in seconds (games may require continued key presses).