<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [server](./server.md) &gt; [PlayerUI](./server.playerui.md) &gt; [lockPointer](./server.playerui.lockpointer.md)

## PlayerUI.lockPointer() method

Locks or unlocks the player's mouse pointer on desktop.

Use for: controlling when mouse input is captured. Do NOT use for: mobile devices (pointer lock has no effect).

**Signature:**

```typescript
lockPointer(lock: boolean): void;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

lock


</td><td>

boolean


</td><td>

True to lock the pointer, false to unlock it.

\*\*Requires:\*\* Player must be in a world.

\*\*Side effects:\*\* Emits `PlayerUIEvent.LOCK_POINTER`<!-- -->.

\*\*Category:\*\* Players


</td></tr>
</tbody></table>
**Returns:**

void

## Remarks

If unlocked, the player cannot use in-game mouse inputs until it is locked again.

