KeyEvent#
- class KeyEvent(*args, **kwargs)#
Superclasses: Event
An event related to a key-based device.
Methods#
- class KeyEvent
- get_consumed_modifiers() ModifierType #
Extracts the consumed modifiers from a key event.
- get_match() Tuple[bool, int, ModifierType] #
Gets a keyval and modifier combination that will match the event.
See
matches
.
- matches(keyval: int, modifiers: ModifierType) KeyMatch #
Matches a key event against a keyval and modifiers.
This is typically used to trigger keyboard shortcuts such as Ctrl-C.
Partial matches are possible where the combination matches if the currently active group is ignored.
Note that we ignore Caps Lock for matching.
- Parameters:
keyval – the keyval to match
modifiers – the modifiers to match