Class: KeyEvent
enum keyboard eventInputSystem
Hierarchy
↳
KeyEvent
Constructors
Properties
- target
- currentTarget
- type
- data
- param
- time
- delay
- mouseCode
- ctrlKey
- metaKey
- altKey
- shiftKey
- targetTouches
- changedTouches
- touches
- view
- KEY_DOWN
- KEY_UP
- keyCode
Accessors
Methods
Constructors
constructor
• new KeyEvent(eventType?
, data?
): KeyEvent
Create a new event, with type and data
Parameters
Name | Type | Default value | Description |
---|---|---|---|
eventType | string | null | {any} eventType |
data | any | null | {any} param |
Returns
Inherited from
Defined in
Properties
target
• target: Object3D
Event target, it's usually event dispatcher
Inherited from
Defined in
currentTarget
• currentTarget: CEventListener
Current event target, it's current bubble object
Inherited from
Defined in
type
• type: string
event type, it's registered string of key
Inherited from
Defined in
data
• data: any
extra data.Used for the transmission process of events, carrying data
Inherited from
Defined in
param
• param: any
The param data when event is registered
Inherited from
Defined in
time
• time: number
= 0
the time when event is
Inherited from
Defined in
delay
• delay: number
= 0
the delay time when event is dispatched.
Inherited from
Defined in
mouseCode
• mouseCode: number
= 0
mouse code, see
Mouse Code
Inherited from
Defined in
ctrlKey
• ctrlKey: boolean
Is Ctrl key pressed when the event occurs
Inherited from
Defined in
metaKey
• metaKey: boolean
Is Meta key pressed when the event occurs
Inherited from
Defined in
altKey
• altKey: boolean
Is Alt key pressed when the event occurs
Inherited from
Defined in
shiftKey
• shiftKey: boolean
Is Shift key pressed when the event occurs
Inherited from
Defined in
targetTouches
• targetTouches: TouchData
[]
Collection of finger touch points, which registered
Inherited from
Defined in
changedTouches
• changedTouches: TouchData
[]
Collection of finger touch points changed
Inherited from
Defined in
touches
• touches: TouchData
[]
Collection of finger touch points
Inherited from
Defined in
view
• view: View3D
binded view3D object in event.
Inherited from
Defined in
KEY_DOWN
▪ Static
KEY_DOWN: string
= 'onKeyDown'
Constant Definition Key Press Event Identification Event response status: Responds every time the keyboard is pressed. Response event parameters: keyboard key
Platform
Web,Native
Defined in
src/event/eventConst/KeyEvent.ts:15
KEY_UP
▪ Static
KEY_UP: string
= 'onKeyUp'
Constant Definition Key up Event Identification Event response status: Responds every time the keyboard is released. Response event parameters: keyboard key
Platform
Web,Native
Defined in
src/event/eventConst/KeyEvent.ts:24
keyCode
• keyCode: number
= 0
Key code value, enumeration type see KeyCode KeyCode
Default
0
Platform
Web,Native
Defined in
src/event/eventConst/KeyEvent.ts:32
Accessors
isStopImmediatePropagation
• get
isStopImmediatePropagation(): boolean
Returns stopImmediatePropagation value
Returns
boolean
Inherited from
CEvent.isStopImmediatePropagation
Defined in
Methods
stopImmediatePropagation
▸ stopImmediatePropagation(): void
Prevent bubbling of all event listeners in subsequent nodes of the current node in the event flow.
Returns
void
Inherited from
CEvent.stopImmediatePropagation