Skip to content

1681-engine / index / requestPointerLock

Function: requestPointerLock() ​

ts
function requestPointerLock(
   element, 
   options?, 
   doc?
): Promise<boolean>;

Defined in: src/platform/pointerLock.ts:33

Asks to lock the pointer to element (the game canvas); resolves whether it holds afterwards. raw asks for unaccelerated movement where the browser offers it, and falls back to the plain lock where it refuses that option.

Parameters ​

ParameterType
elementElement
options{ raw?: boolean; }
options.raw?boolean
docPointerLockDocument | null

Returns ​

Promise<boolean>

Released under the MIT License.