<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [client](./client.md) &gt; [HytopiaUI](./client.hytopiaui.md) &gt; [lockPointer](./client.hytopiaui.lockpointer.md)

## HytopiaUI.lockPointer() method

Controls pointer lock for your UI. When locked, the cursor is hidden and mouse movement controls the camera. Call with `true` when hiding your UI so players can control the camera, `false` when showing UI that needs cursor interaction. Pointer lock only affects Desktop devices.

**Signature:**

```typescript
lockPointer(lock: boolean, maintainInput?: 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 pointer and hide cursor, `false` to unlock and show cursor


</td></tr>
<tr><td>

maintainInput


</td><td>

boolean


</td><td>

_(Optional)_ When `true`<!-- -->, keyboard movement/inputs for gameplay still work while pointer is unlocked (default: `false`<!-- -->)


</td></tr>
</tbody></table>

**Returns:**

void

