Back to Aframe

vive-focus-controls

docs/components/vive-focus-controls.md

1.7.12.0 KB
Original Source

The vive-focus-controls component interfaces with the Vive Focus controller. It wraps the tracked-controls component while adding button mappings, events, and an Vive Focus controller model that highlights the touched and/or pressed buttons (trackpad, trigger).

Example

html
<!-- Match Vive Focus controller if present, regardless of hand. -->
<a-entity vive-focus-controls></a-entity>

<!-- Match Vive Focus controller if present and for specified hand. -->
<a-entity vive-focus-controls="hand: left"></a-entity>
<a-entity vive-focus-controls="hand: right"></a-entity>

Value

PropertyDescriptionDefault
buttonTouchedColorButton colors when touched (Trackpad only).#777777
buttonHighlightColorButton colors when pressed and active.#FFFFFF
handThe hand that will be tracked (e.g., right, left).
modelWhether the Vive Focus controller model is loaded.true

Events

Event NameDescription
trackpadchangedTrackpad changed.
trackpaddownTrackpad pressed.
trackpadmovedTrackpad axis changed.
trackpadupTrackpad released.
trackpadtouchstartTrackpad touched.
trackpadtouchendTrackpad not touched.
triggerchangedTrigger changed.
triggerdownTrigger pressed.
triggerupTrigger released.

As this controller's buttons are digital, the changed events only fire when a button is fully pressed or released (value 0 or 1).

Assets