Kraken Logo

Kraken Engine

DocumentationGuidesShowcaseCommunity
Ctrl
K
Navigating the Docs
Building Docs
Overview
Camera
Color
Draw
Ease
Event
Fx
Gamepad
Input
Log
Math
Mixer
Mouse
Physics
Pixel Array
Renderer
Shaders
Time
Transform
Ui
Viewport
Window

Built bydurkisneer1.Kraken Engine is open source and available onGitHub.

  1. Docs
  2. Functions
  3. Event

Event

Input event handling


Poll

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

new_custom() → Eventnew_custom() → Event

Create a new custom event type.

Returns

Event : The newly registered custom Event.

Raises

  • RuntimeError : If registration fails.

Push

push(event: Event) → Nonepush(event: Event) → None

Push 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

schedule(event: Event, delay_ms: int, repeat: bool = False) → Noneschedule(event: Event, delay_ms: int, repeat: bool = False) → None

Schedule 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

unschedule(event: Event) → Noneunschedule(event: Event) → None

Cancel a scheduled event timer.

Args

  • event : The custom event whose timer should be cancelled.

Start Text Input

start_text_input() → Nonestart_text_input() → None

Start text input for TEXT_INPUT and TEXT_EDITING events.

Raises

  • RuntimeError : If text input could not be started.

Stop Text Input

stop_text_input() → Nonestop_text_input() → None

Stop text input for TEXT_INPUT and TEXT_EDITING events.

Raises

  • RuntimeError : If text input could not be stopped.
PreviousEase
NextFx

On this page

PollNew CustomPushScheduleUnscheduleStart Text InputStop Text Input