textual.events.Key
class
¶
Bases: InputEvent
Sent when the user hits a key on the keyboard.
- Bubbles
- Verbose
Parameters
Parameter | Default | Description |
---|---|---|
key
str
|
required | The key that was pressed. |
character
str | None
|
required | A printable character or |
aliases
instance-attribute
¶
The aliases for the key, including the key itself.
character
instance-attribute
¶
A printable character or None
if it is not printable.
is_printable
property
¶
Check if the key is printable (produces a unicode character).
Returns
Type | Description |
---|---|
bool
|
|
name_aliases
property
¶
The corresponding name for every alias in aliases
list.