Skip to content

KeyboardEvent

Inherits: Event['Page']

Event payload for keyboard key-down notifications.

Delivered to Page.on_keyboard_event.

Properties

  • alt(bool) –

    Whether Alt was pressed when the key event was emitted.

  • ctrl(bool) –

    Whether Control was pressed when the key event was emitted.

  • key(str) –

    Human-readable key label for the pressed key.

  • meta(bool) –

    Whether Meta (Command/Windows) was pressed when the key event was emitted.

  • shift(bool) –

    Whether Shift was pressed when the key event was emitted.

Properties#

alt instance-attribute #

alt: bool

Whether Alt was pressed when the key event was emitted.

ctrl instance-attribute #

ctrl: bool

Whether Control was pressed when the key event was emitted.

key instance-attribute #

key: str

Human-readable key label for the pressed key.

meta instance-attribute #

meta: bool

Whether Meta (Command/Windows) was pressed when the key event was emitted.

shift instance-attribute #

shift: bool

Whether Shift was pressed when the key event was emitted.