KeyboardEvent
Event payload for keyboard key-down notifications.
Delivered to Page.on_keyboard_event.
Inherits: Event
Properties
alt- Whether Alt was pressed when the key event was emitted.ctrl- Whether Control was pressed when the key event was emitted.key- The pressed key, such asA,ENTERorF5.meta- Whether Meta (Command/Windows) was pressed when the key event was emitted.physical_key- The position of the key that was pressed on the keyboard, such asW, whatever the active layout.shift- Whether Shift was pressed when the key event was emitted.
Properties
keyinstance-attribute
key: KeyboardKey | strThe pressed key, such as A,
ENTER or F5.
A key that has no KeyboardKey member is a plain string,
such as "Ü".
metainstance-attribute
meta: boolWhether Meta (Command/Windows) was pressed when the key event was emitted.
physical_keyinstance-attribute
physical_key: PhysicalKeyboardKey | intThe position of the key that was pressed on the keyboard, such as
W, whatever the active layout.
A key that has no PhysicalKeyboardKey member is its USB HID
usage code.