# Key Event
Name
Bubble Supported
Description
onKeyEvent(event: (event?: KeyEvent) => void)
Yes
Called when a key event occurs. For details about the event parameters, see KeyEvent Object.
Type
type
KeyType
Type of a key.
keyCode
number
Key code.
keyText
string
Key value.
keySource
KeySource
Type of the input device that triggers the key event.
deviceId
ID of the input device that triggers the key event.
metaKey
State of the metakey when the key is pressed. The value 1 means the pressed state, and 0 means the unpressed state.
timestamp
Timestamp when the key is pressed.
stopPropagation(): void
Stops the event from bubbling upwards or downwards.
Down
The key is pressed.
Up
The key is released.
Unknown
Unknown input device.
Keyboard
The input device is a keyboard.
Value
Behavior
Physical Button
19
Upward
Up button.
20
Downward
Down button.
21
Leftward
Left button.
22
Rightward
Right button.
23
OK
OK key on a remote control.
66
Enter key on a keyboard.
160
Enter button on the numeric keypad.