Input event handling
poll() → list[Event]poll() → list[Event]Poll for all pending user input events.
This clears input states and returns a list of events that occurred since the last call.
Returns
list[Event] : A list of input event objects.
new_custom() → Eventnew_custom() → EventCreate a new custom event type.
Returns
Event : The newly registered custom Event.
Raises
RuntimeError : If registration fails.push(event: Event) → Nonepush(event: Event) → NonePush a custom event to the event queue.
Args
event : The custom event to push to the queue.Raises
ValueError : If the event is not a custom event type.RuntimeError : If the event could not be queued.schedule(event: Event, delay_ms: int, repeat: bool = False) → Noneschedule(event: Event, delay_ms: int, repeat: bool = False) → NoneSchedule a custom event to be pushed after a delay. Will overwrite any existing timer for the same event.
Args
event : The custom event to schedule.delay_ms : Delay in milliseconds before the event is pushed.repeat : If True, the event will be pushed repeatedly at the
specified interval. If False, the event is pushed only once. Defaults to False.Raises
ValueError : If the event is not a custom event type.RuntimeError : If the timer could not be created.unschedule(event: Event) → Noneunschedule(event: Event) → NoneCancel a scheduled event timer.
Args
event : The custom event whose timer should be cancelled.start_text_input() → Nonestart_text_input() → NoneStart text input for TEXT_INPUT and TEXT_EDITING events.
Raises
RuntimeError : If text input could not be started.stop_text_input() → Nonestop_text_input() → NoneStop text input for TEXT_INPUT and TEXT_EDITING events.
Raises
RuntimeError : If text input could not be stopped.