XRSession: squeezeend event

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Want more browser support for this feature? Tell us why.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The WebXR event squeezeend is sent to an XRSession when one of its input sources ends its primary action or when an input source that's in the process of handling an ongoing primary action is disconnected without successfully completing the action.

Primary squeeze actions include things like users pressing triggers or buttons, tapping a touchpad, speaking a command, or performing a recognizable gesture when using a video tracking system or handheld controller with an accelerometer.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

js
addEventListener("squeezeend", (event) => { })

onsqueezeend = (event) => { }

Event type

An XRInputSourceEvent. Inherits from Event.

Event XRInputSourceEvent

Description

Trigger

Triggered when users stop squeezing the controller, making a hand gesture that mimes grabbing something, or using (squeezing) a trigger.

Use cases

The squeezestart event is sent indicating that the user has begun a squeeze action.

If the primary squeeze action ends successfully, the session is sent a squeeze event.

A squeezeend event is sent to indicate that the squeeze action is no longer underway. This is sent whether the squeeze action succeeded or not.

Examples

See the squeezestart event for example code.

Specifications

Specification
WebXR Device API
# eventdef-xrsession-squeezeend
WebXR Device API
# dom-xrsession-onsqueezeend

Browser compatibility