Unity-Technologies / furioos-sdk-js

Furioos SDK for JavaScript
30 stars 14 forks source link

Cursor locking issues #38

Open peettee opened 3 years ago

peettee commented 3 years ago

In our application we have the requirement to lock/unlock the cursor quite frequently. As I do not want the user to constantly click on the iframe if the cursor is locked the remote application sends a cursor locking signal to the js frontend indicating that the cursor needs locking. This works fine basically, the cursor is hidden and locked as I only need an explicit user gesture the first time the cursor is locked (except if the escape key is pressed).

However the furioos player keeps displaying "click to lock cursor" in the lower right corner even if the cursor is already locked and after the cursor is locked no mouse input whatsoever is transmitted to the remote application. Is there someway to tell the player that the cursor is locked? There are maximize()/minimize() methods but no cursor locking methods available.

The following code is executed whenever I receive a cursor lock request through the OnSDKMessage callback:

var iframe = document.getElementById("furioos-sdk-iframe");
iframe.requestPointerLock = iframe.requestPointerLock || iframe.mozRequestPointerLock ||  iframe.webkitRequestPointerLock;
iframe.requestPointerLock();
K-MICK commented 3 years ago

Hello,

Thank you for the feedback, we will investigate the issue and keep you updated.

Regards