kettle11 / kapp

A pure Rust window and input library for Windows, Mac, and Web. (Work in progress)
Apache License 2.0
56 stars 4 forks source link

Implement `set_mouse_position` for Web #4

Closed kettle11 closed 3 years ago

kettle11 commented 4 years ago

https://github.com/kettle11/kettlewin/blob/e0bb32b4e9083493bafcc53e5e97f00a24978536/platforms/web/src/application_web.rs#L30

set_mouse_position should set the mouse position relative to the current window (or canvas?)

Investigate pointer lock API here: https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API

Perhaps other platforms should be implemented to have a similar API, as "locking" the pointer seems to be the most common use case for moving the mouse.

kettle11 commented 3 years ago

Closing this because set_mouse_position is impossible (as far as I know) on web and lock_mouse_position will be used instead.