InterfaceGestureModuleWearable Only

Detects gestures made by the hand using an ML algorithm.

@component
export class PinchExample extends BaseScriptComponent {
private gestureModule: GestureModule = require('LensStudio:GestureModule');
onAwake() {
this.gestureModule
.getPinchDownEvent(GestureModule.HandType.Right)
.add((pinchDownArgs: PinchDownArgs) => {
print('Right Hand Pinch Down');
});

this.gestureModule
.getPinchUpEvent(GestureModule.HandType.Right)
.add((pinchUpArgs: PinchUpArgs) => {
print('Right Hand Pinch Up');
});

this.gestureModule
.getPinchStrengthEvent(GestureModule.HandType.Right)
.add((pinchStrengthArgs: PinchStrengthArgs) => {
print('Right Hand Pinch Strength: ' + pinchStrengthArgs.strength);
});
}
}
interface GestureModule {
    name: string;
    uniqueIdentifier: string;
    getPalmTapDownEvent(handType: GestureModule.HandType): any;
    getPalmTapUpEvent(handType: GestureModule.HandType): any;
    getPinchDownEvent(handType: GestureModule.HandType): any;
    getPinchStrengthEvent(handType: GestureModule.HandType): any;
    getPinchUpEvent(handType: GestureModule.HandType): any;
    getTargetingDataEvent(handType: GestureModule.HandType): any;
    getTypeName(): string;
    isOfType(type: string): boolean;
    isSame(other: ScriptObject): boolean;
}

Hierarchy (view full)

Properties

name: string

The name of the Asset in Lens Studio.

uniqueIdentifier: string

Methods

  • Triggered when the left index finger from one hand touches the palm on the opposite hand. Currently, only the palm tap to the left hand is supported.

    Parameters

    Returns any

  • Triggered when the left index finger from one hand lifts from the palm on the opposite hand after touching. Currently, only the palm tap to the left hand is supported.

    Parameters

    Returns any

  • Triggered when the thumb and index fingers of the hand in view are pinched together.

    Parameters

    Returns any

  • Get the strength of a pinch between the thumb and index fingers of the hand in view.

    Parameters

    Returns any

  • Triggered when the thumb and index fingers of the hand in view are separated after being pinched together.

    Parameters

    Returns any

  • Triggered when the user has an intent to target a digital content in space.

    Parameters

    Returns any

  • Returns the name of this object's type.

    Returns string

  • Returns true if the object matches or derives from the passed in type.

    Parameters

    • type: string

    Returns boolean

  • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

    Parameters

    Returns boolean