mini_arcade_core.backend.events

Core event types and structures.

Classes

EventType

High-level event types understood by the core.

Event

Core event type.

Module Contents

class mini_arcade_core.backend.events.EventType(*args, **kwds)[source]

Bases: enum.Enum

High-level event types understood by the core.

Variables:
  • UNKNOWN – Unknown/unhandled event.

  • QUIT – User requested to quit the game.

  • KEYDOWN – A key was pressed.

  • KEYUP – A key was released.

  • MOUSEMOTION – The mouse was moved.

  • MOUSEBUTTONDOWN – A mouse button was pressed.

  • MOUSEBUTTONUP – A mouse button was released.

  • MOUSEWHEEL – The mouse wheel was scrolled.

  • WINDOWRESIZED – The window was resized.

  • TEXTINPUT – Text input event (for IME support).

UNKNOWN
QUIT
KEYDOWN
KEYUP
ACTIONDOWN
ACTIONUP
AXISMOTION
MOUSEMOTION
MOUSEBUTTONDOWN
MOUSEBUTTONUP
MOUSEWHEEL
WINDOWRESIZED
TEXTINPUT
class mini_arcade_core.backend.events.Event[source]

Core event type.

For now we only care about: - type: what happened - key: integer key code (e.g. ESC = 27), or None if not applicable

Variables:
  • (EventType) (type) – The type of event.

  • None) (value (float |) – The key associated with the event, if any.

  • None) – The key code associated with the event, if any.

  • None) – The hardware scancode of the key, if any.

  • None) – Modifier keys bitmask, if any.

  • None) – Whether this key event is a repeat, if any.

  • None) – Mouse X position, if any.

  • None) – Mouse Y position, if any.

  • None) – Mouse delta X, if any.

  • None) – Mouse delta Y, if any.

  • None) – Mouse button number, if any.

  • None) – Mouse wheel scroll (x, y), if any.

  • None) – New window size (width, height), if any.

  • None) – Text input, if any.

  • None) – Logical action/button id (controller/CV/etc).

  • None) – Logical axis id.

  • None) – Axis value for AXISMOTION events.

type: EventType
key: mini_arcade_core.backend.keys.Key | None = None
key_code: int | None = None
scancode: int | None = None
mod: int | None = None
repeat: bool | None = None
x: int | None = None
y: int | None = None
dx: int | None = None
dy: int | None = None
button: int | None = None
wheel: Tuple[int, int] | None = None
size: Tuple[int, int] | None = None
text: str | None = None
action: str | None = None
axis: str | None = None
value: float | None = None