Skip to main content

6 docs tagged with "mouse"

View all tags

Basic Mouse Input

Use the Mouse API to read movement, button presses, and consistent screen coordinates across browsers for interactive controls.

Detecting a double click

Detect double-clicks with timing logic and use them to move the camera or trigger actions on desktop browsers.

Detecting a long press

Measure press duration on touch or mouse to fire actions after the user holds on an element long enough.

Locking the mouse

Request pointer lock on click to capture the mouse for first-person look, hiding the cursor while movement drives the camera.

Point and click movement

Move a character or object toward clicked ground positions using screen-to-world raycasts for simple navigation.

Rotating Objects with Mouse

Orbit or spin an object by mapping mouse drag deltas in screen space to rotation quaternions or euler angles each frame.