mini_arcade_core.backend.events =============================== .. py:module:: mini_arcade_core.backend.events .. autoapi-nested-parse:: Core event types and structures. Classes ------- .. autoapisummary:: mini_arcade_core.backend.events.EventType mini_arcade_core.backend.events.Event Module Contents --------------- .. py:class:: EventType(*args, **kwds) Bases: :py:obj:`enum.Enum` High-level event types understood by the core. :cvar UNKNOWN: Unknown/unhandled event. :cvar QUIT: User requested to quit the game. :cvar KEYDOWN: A key was pressed. :cvar KEYUP: A key was released. :cvar MOUSEMOTION: The mouse was moved. :cvar MOUSEBUTTONDOWN: A mouse button was pressed. :cvar MOUSEBUTTONUP: A mouse button was released. :cvar MOUSEWHEEL: The mouse wheel was scrolled. :cvar WINDOWRESIZED: The window was resized. :cvar TEXTINPUT: Text input event (for IME support). .. py:attribute:: UNKNOWN .. py:attribute:: QUIT .. py:attribute:: KEYDOWN .. py:attribute:: KEYUP .. py:attribute:: ACTIONDOWN .. py:attribute:: ACTIONUP .. py:attribute:: AXISMOTION .. py:attribute:: MOUSEMOTION .. py:attribute:: MOUSEBUTTONDOWN .. py:attribute:: MOUSEBUTTONUP .. py:attribute:: MOUSEWHEEL .. py:attribute:: WINDOWRESIZED .. py:attribute:: TEXTINPUT .. py:class:: Event 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 :ivar type (EventType): The type of event. :ivar key (Key | None): The key associated with the event, if any. :ivar key_code (int | None): The key code associated with the event, if any. :ivar scancode (int | None): The hardware scancode of the key, if any. :ivar mod (int | None): Modifier keys bitmask, if any. :ivar repeat (bool | None): Whether this key event is a repeat, if any. :ivar x (int | None): Mouse X position, if any. :ivar y (int | None): Mouse Y position, if any. :ivar dx (int | None): Mouse delta X, if any. :ivar dy (int | None): Mouse delta Y, if any. :ivar button (int | None): Mouse button number, if any. :ivar wheel (Tuple[int, int] | None): Mouse wheel scroll (x, y), if any. :ivar size (Tuple[int, int] | None): New window size (width, height), if any. :ivar text (str | None): Text input, if any. :ivar action (str | None): Logical action/button id (controller/CV/etc). :ivar axis (str | None): Logical axis id. :ivar value (float | None): Axis value for AXISMOTION events. .. py:attribute:: type :type: EventType .. py:attribute:: key :type: mini_arcade_core.backend.keys.Key | None :value: None .. py:attribute:: key_code :type: Optional[int] :value: None .. py:attribute:: scancode :type: Optional[int] :value: None .. py:attribute:: mod :type: Optional[int] :value: None .. py:attribute:: repeat :type: Optional[bool] :value: None .. py:attribute:: x :type: Optional[int] :value: None .. py:attribute:: y :type: Optional[int] :value: None .. py:attribute:: dx :type: Optional[int] :value: None .. py:attribute:: dy :type: Optional[int] :value: None .. py:attribute:: button :type: Optional[int] :value: None .. py:attribute:: wheel :type: Optional[Tuple[int, int]] :value: None .. py:attribute:: size :type: Optional[Tuple[int, int]] :value: None .. py:attribute:: text :type: Optional[str] :value: None .. py:attribute:: action :type: Optional[str] :value: None .. py:attribute:: axis :type: Optional[str] :value: None .. py:attribute:: value :type: Optional[float] :value: None