joystick#

class platypush.message.event.joystick.JoystickAxisEvent(name, bases, namespace, /, **kwargs)[source]#

Bases: _JoystickEvent

Event triggered when an axis value of the joystick changes.

__init__(*args, axis: int | str, value: int, **kwargs)[source]#
Parameters:
  • axis – Axis index or name.

  • value – Axis value.

class platypush.message.event.joystick.JoystickButtonPressedEvent(name, bases, namespace, /, **kwargs)[source]#

Bases: _JoystickEvent

Event triggered when a joystick button is pressed.

__init__(*args, button: int | str, **kwargs)[source]#
Parameters:

button – Button index or name.

class platypush.message.event.joystick.JoystickButtonReleasedEvent(name, bases, namespace, /, **kwargs)[source]#

Bases: _JoystickEvent

Event triggered when a joystick button is released.

__init__(*args, button: int | str, **kwargs)[source]#
Parameters:

button – Button index or name.

class platypush.message.event.joystick.JoystickConnectedEvent(name, bases, namespace, /, **kwargs)[source]#

Bases: _JoystickEvent

Event triggered upon joystick connection.

__init__(*args, name: str | None = None, axes: Iterable[int | str] | None = None, buttons: Iterable[int | str] | None = None, **kwargs)[source]#
Parameters:
  • name – Device name.

  • axes – List of the device axes, as indices or names.

  • buttons – List of the device buttons, as indices or names.

class platypush.message.event.joystick.JoystickDisconnectedEvent(name, bases, namespace, /, **kwargs)[source]#

Bases: _JoystickEvent

Event triggered upon joystick disconnection.

class platypush.message.event.joystick.JoystickEvent(code, state, *args, **kwargs)[source]#

Bases: Event

Generic joystick event.

__init__(code, state, *args, **kwargs)[source]#
Parameters:
  • code (str) – Event code, usually the code of the source key/handle

  • state (int) – State of the triggering element. Can be 0/1 for a button, -1/0/1 for an axis, a discrete integer for an analog input etc.

class platypush.message.event.joystick.JoystickStateEvent(name, bases, namespace, /, **kwargs)[source]#

Bases: _JoystickEvent

Event triggered when the state of the joystick changes.

__init__(*args, axes: Iterable[int], buttons: Iterable[bool], **kwargs)[source]#
Parameters:
  • axes – Joystick axes values, as a list of integer values.

  • buttons – Joystick buttons values, as a list of boolean values (True for pressed, False for released).