Skip to content

Class: KeyEvent

enum keyboard eventInputSystem

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

constructor

new KeyEvent(eventType?, data?): KeyEvent

Create a new event, with type and data

Parameters

NameTypeDefault valueDescription
eventTypestringnull{any} eventType
dataanynull{any} param

Returns

KeyEvent

Inherited from

CEvent.constructor

Defined in

src/event/CEvent.ts:97

Properties

target

target: Object3D

Event target, it's usually event dispatcher

Inherited from

CEvent.target

Defined in

src/event/CEvent.ts:13


currentTarget

currentTarget: CEventListener

Current event target, it's current bubble object

Inherited from

CEvent.currentTarget

Defined in

src/event/CEvent.ts:18


type

type: string

event type, it's registered string of key

Inherited from

CEvent.type

Defined in

src/event/CEvent.ts:23


data

data: any

extra data.Used for the transmission process of events, carrying data

Inherited from

CEvent.data

Defined in

src/event/CEvent.ts:28


param

param: any

The param data when event is registered

Inherited from

CEvent.param

Defined in

src/event/CEvent.ts:34


time

time: number = 0

the time when event is

Inherited from

CEvent.time

Defined in

src/event/CEvent.ts:40


delay

delay: number = 0

the delay time when event is dispatched.

Inherited from

CEvent.delay

Defined in

src/event/CEvent.ts:46


mouseCode

mouseCode: number = 0

mouse code, see

Mouse Code

MouseCode

Inherited from

CEvent.mouseCode

Defined in

src/event/CEvent.ts:52


ctrlKey

ctrlKey: boolean

Is Ctrl key pressed when the event occurs

Inherited from

CEvent.ctrlKey

Defined in

src/event/CEvent.ts:57


altKey

altKey: boolean

Is Alt key pressed when the event occurs

Inherited from

CEvent.altKey

Defined in

src/event/CEvent.ts:62


shiftKey

shiftKey: boolean

Is Shift key pressed when the event occurs

Inherited from

CEvent.shiftKey

Defined in

src/event/CEvent.ts:67


targetTouches

targetTouches: TouchData[]

Collection of finger touch points, which registered

Inherited from

CEvent.targetTouches

Defined in

src/event/CEvent.ts:72


changedTouches

changedTouches: TouchData[]

Collection of finger touch points changed

Inherited from

CEvent.changedTouches

Defined in

src/event/CEvent.ts:77


touches

touches: TouchData[]

Collection of finger touch points

Inherited from

CEvent.touches

Defined in

src/event/CEvent.ts:82


view

view: View3D

binded view3D object in event.

Inherited from

CEvent.view

Defined in

src/event/CEvent.ts:89


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

ts
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

src/event/CEvent.ts:120

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

Defined in

src/event/CEvent.ts:105