# Interface XRGestureEvent

XR 手势事件（按键、摇杆方向等离散输入）

interface XRGestureEvent {
buttons:
| "Y"
| "X"
| "B"
| "A"
| "RightTrigger"
| "RightPinch"
| "LeftTrigger"
| "LeftPinch"
| "LeftAxesLeft"
| "LeftAxesRight"
| "LeftAxesUp"
| "LeftAxesDown"
| "RightAxesLeft"
| "RightAxesRight"
| "RightAxesUp"
| "RightAxesDown";
controllers: { raycaster: { leftRay: Raycaster; rightRay: Raycaster } };
defaultPrevented: boolean;
isFinal: boolean;
isFirst: boolean;
machineType: "Pico" | "Oculus";
session: XRSession | null;
timeStamp: number;
type: string;
preventDefault(): void;
}

#### Hierarchy (View Summary)

- BaseEvent
  - XRGestureEvent

- Defined in lib/five/utils/event.ts:174

##### Index

### Properties

buttons
controllers
defaultPrevented
isFinal
isFirst
machineType
session
timeStamp
type

### Methods

preventDefault

## Properties

### buttons

buttons:
| "Y"
| "X"
| "B"
| "A"
| "RightTrigger"
| "RightPinch"
| "LeftTrigger"
| "LeftPinch"
| "LeftAxesLeft"
| "LeftAxesRight"
| "LeftAxesUp"
| "LeftAxesDown"
| "RightAxesLeft"
| "RightAxesRight"
| "RightAxesUp"
| "RightAxesDown"

触发该手势的按键或摇杆方向

- Defined in lib/five/utils/event.ts:178

### controllers

controllers: { raycaster: { leftRay: Raycaster; rightRay: Raycaster } }

控制器射线信息

- Defined in lib/five/utils/event.ts:186

### `Readonly` defaultPrevented

defaultPrevented: boolean

是否已调用过 preventDefault

Inherited from BaseEvent.defaultPrevented

- Defined in lib/five/utils/event.ts:23

### isFinal

isFinal: boolean

是否为该手势序列的最后一个事件

- Defined in lib/five/utils/event.ts:184

### isFirst

isFirst: boolean

是否为该手势序列的第一个事件

- Defined in lib/five/utils/event.ts:182

### machineType

machineType: "Pico" | "Oculus"

XR 设备类型

- Defined in lib/five/utils/event.ts:180

### session

session: XRSession | null

当前 XR 会话

- Defined in lib/five/utils/event.ts:176

### timeStamp

timeStamp: number

事件触发时的时间戳

Inherited from BaseEvent.timeStamp

- Defined in lib/five/utils/event.ts:19

### type

type: string

事件类型名称

Inherited from BaseEvent.type

- Defined in lib/five/utils/event.ts:17

## Methods

### preventDefault

- preventDefault(): void

  阻止事件的默认行为

  #### Returns void

  Inherited from BaseEvent.preventDefault

  - Defined in lib/five/utils/event.ts:21