# Interface XRControllerEvent

XR 控制器输入事件

interface XRControllerEvent {
buttons: {
A: boolean;
B: boolean;
LeftPinch: boolean;
LeftTrigger: boolean;
RightPinch: boolean;
RightTrigger: boolean;
X: boolean;
Y: boolean;
};
defaultPrevented: boolean;
left: XRControllerState;
right: XRControllerState;
timeStamp: number;
type: string;
preventDefault(): void;
}

#### Hierarchy (View Summary)

- BaseEvent
  - XRControllerEvent

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

##### Index

### Properties

buttons
defaultPrevented
left
right
timeStamp
type

### Methods

preventDefault

## Properties

### buttons

buttons: {
A: boolean;
B: boolean;
LeftPinch: boolean;
LeftTrigger: boolean;
RightPinch: boolean;
RightTrigger: boolean;
X: boolean;
Y: boolean;
}

各按键的按下状态

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

### `Readonly` defaultPrevented

defaultPrevented: boolean

是否已调用过 preventDefault

Inherited from BaseEvent.defaultPrevented

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

### left

left: XRControllerState

左手控制器状态

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

### right

right: XRControllerState

右手控制器状态

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

### 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