wijjit.core.events.KeyEvent

class wijjit.core.events.KeyEvent(event_type=None, timestamp=<factory>, cancelled=False, key='', modifiers=<factory>, key_obj=None)[source]

Keyboard input event.

Fired when a key is pressed.

Parameters:
  • key (str) – The key that was pressed

  • modifiers (List[str]) – Modifier keys (ctrl, alt, shift)

  • key_obj (Any or None) – The original Key object from InputHandler

  • event_type (EventType | None)

  • timestamp (datetime)

  • cancelled (bool)

Variables:
  • key (str) – The key that was pressed

  • modifiers (list[str]) – Modifier keys (ctrl, alt, shift)

  • key_obj (Any or None) – The original Key object from InputHandler

__init__(event_type=None, timestamp=<factory>, cancelled=False, key='', modifiers=<factory>, key_obj=None)
Parameters:
Return type:

None

Methods

__init__([event_type, timestamp, cancelled, ...])

cancel()

Cancel the event.

Attributes

cancelled

event_type

key

key_obj

modifiers

timestamp

key: str = ''
modifiers: list[str]
key_obj: Any | None = None
__post_init__()[source]

Initialize event type.

Return type:

None