Skip to content

Scene Key Events

KeyEvent

KeyEvent(engine: Engine)

Bases: SceneEvent, CancellableEvent

Base key event implementation.

key property

key: int

The key that this event relates to.

mods property

mods: int

The bitwise-combined keycodes of all modification keys pressed at the time of this event.

engine property

engine: Engine

The engine that is handling this plugin and dispatched this event.

is_cancelled property

is_cancelled: bool

Check if this event has already been cancelled.

scene property

scene: Scene

The active scene that dispatched this event.

cancel

cancel() -> None

Cancel this event from being further handled.

KeyPressedEvent

KeyPressedEvent(engine: Engine)

Bases: KeyEvent

Dispatched when the scene recognizes that a key has been pressed.

engine property

engine: Engine

The engine that is handling this plugin and dispatched this event.

is_cancelled property

is_cancelled: bool

Check if this event has already been cancelled.

scene property

scene: Scene

The active scene that dispatched this event.

key property

key: int

The key that this event relates to.

mods property

mods: int

The bitwise-combined keycodes of all modification keys pressed at the time of this event.

cancel

cancel() -> None

Cancel this event from being further handled.

KeyPressingEvent

KeyPressingEvent(engine: Engine)

Bases: KeyEvent

Dispatched when the scene recognizes that a key is currently being pressed.

engine property

engine: Engine

The engine that is handling this plugin and dispatched this event.

is_cancelled property

is_cancelled: bool

Check if this event has already been cancelled.

scene property

scene: Scene

The active scene that dispatched this event.

key property

key: int

The key that this event relates to.

mods property

mods: int

The bitwise-combined keycodes of all modification keys pressed at the time of this event.

cancel

cancel() -> None

Cancel this event from being further handled.

KeyReleasedEvent

KeyReleasedEvent(engine: Engine)

Bases: KeyEvent

Dispatched when the scene recognizes that a key has been released.

engine property

engine: Engine

The engine that is handling this plugin and dispatched this event.

is_cancelled property

is_cancelled: bool

Check if this event has already been cancelled.

scene property

scene: Scene

The active scene that dispatched this event.

key property

key: int

The key that this event relates to.

mods property

mods: int

The bitwise-combined keycodes of all modification keys pressed at the time of this event.

cancel

cancel() -> None

Cancel this event from being further handled.