Source code for platypush.message.event.joystick
from abc import ABC
from platypush.message.event import Event
[docs]
class JoystickEvent(Event, ABC):
"""
Base joystick event class.
"""
[docs]
def __init__(self, device: dict, *args, **kwargs):
"""
:param device: Joystick device info as a dictionary:
.. schema:: joystick.JoystickDeviceSchema
"""
super().__init__(*args, device=device, **kwargs)
[docs]
class JoystickConnectedEvent(JoystickEvent):
"""
Event triggered upon joystick connection.
"""
[docs]
class JoystickDisconnectedEvent(JoystickEvent):
"""
Event triggered upon joystick disconnection.
"""
[docs]
class JoystickStateEvent(JoystickEvent):
"""
Base joystick state event class.
"""
[docs]
def __init__(self, *args, state: dict, **kwargs):
"""
:param state: Joystick state as a dictionary:
.. schema:: joystick.JoystickStateSchema
"""
super().__init__(*args, state=state, **kwargs)
# vim:sw=4:ts=4:et: