platypush.message.event.joystick

class platypush.message.event.joystick.JoystickAxisEvent(*args, axis: Union[int, str], value: int, **kwargs)[source]

Event triggered when an axis value of the joystick changes.

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

  • value – Axis value.

class platypush.message.event.joystick.JoystickButtonPressedEvent(*args, button: Union[int, str], **kwargs)[source]

Event triggered when a joystick button is pressed.

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

button – Button index or name.

class platypush.message.event.joystick.JoystickButtonReleasedEvent(*args, button: Union[int, str], **kwargs)[source]

Event triggered when a joystick button is released.

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

button – Button index or name.

class platypush.message.event.joystick.JoystickConnectedEvent(*args, name: Optional[str] = None, axes: Optional[Iterable[Union[int, str]]] = None, buttons: Optional[Iterable[Union[int, str]]] = None, **kwargs)[source]

Event triggered upon joystick connection.

__init__(*args, name: Optional[str] = None, axes: Optional[Iterable[Union[int, str]]] = None, buttons: Optional[Iterable[Union[int, str]]] = 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(device: str, **kwargs)[source]

Event triggered upon joystick disconnection.

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

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(*args, axes: Iterable[int], buttons: Iterable[bool], **kwargs)[source]

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).