API

Interface XrInputCallbacks

Optional callbacks fired by the input manager during a session.

interface XrInputCallbacks {
    onInputSourcesChange?: (
        added: readonly XrInputSource[],
        removed: readonly XrInputSource[],
    ) => void;
    onSelect?: (input: XrInputSource) => void;
    onSelectEnd?: (input: XrInputSource) => void;
    onSelectStart?: (input: XrInputSource) => void;
    onSqueeze?: (input: XrInputSource) => void;
    onSqueezeEnd?: (input: XrInputSource) => void;
    onSqueezeStart?: (input: XrInputSource) => void;
}
Index
onInputSourcesChange?: (
    added: readonly XrInputSource[],
    removed: readonly XrInputSource[],
) => void

Fired when the session's input-source list changes (connect/disconnect).

onSelect?: (input: XrInputSource) => void

Fired on a completed primary action (trigger).

onSelectEnd?: (input: XrInputSource) => void
onSelectStart?: (input: XrInputSource) => void
onSqueeze?: (input: XrInputSource) => void

Fired on a completed squeeze action (grip).

onSqueezeEnd?: (input: XrInputSource) => void
onSqueezeStart?: (input: XrInputSource) => void