Web APIs

Pointer Lock API

Checking compatibility...

Lock the pointer to the content, enabling immersive experiences like games and applications that require unlimited pointer movement.

Basic Lock

Lock the mouse cursor to your application. This example shows how to request pointer lock, handle user permissions, and detect when the lock is gained or lost.

=
=
=
=
=
=

Output

Click Run to see output...

Movement Tracking

Track how far the mouse moves rather than its position on screen. This example demonstrates how to use movement deltas instead of absolute coordinates, which is essential for unlimited mouse movement.

=
=
=
=
=
=

Output

Click Run to see output...

Game Demo

Create a simple game control system using pointer lock. This example shows a practical implementation with character movement and camera control similar to what you'd find in first-person games.

=
=
=
=
=
=

Output

Click Run to see output...