Is there any way to do Element.requestPointerLock(...
# javascript
m
Is there any way to do Element.requestPointerLock() in kotlin js? I understand this is marked as experimental in the mozilla docs and therefore not included in the kotlin js element specification. Is there a way to add this in my app?
r
You can always do
element.asDynamic().requestPointerLock()
m
Aha! thanks!
b
What does that api do?
1
m
It captures the pointer in the element. Mostly used for games where the mouse movement is the controller.
j
Copy code
inline fun Element.requestPointerLock() = asDynamic().requestPointerLock()
then just use
element.requestPointerLock()
anywhere? Seems you can't do
external fun Element.requestPointerLock()
unfortunately.
m
nice @Jorrit ill use that