Class GamepadEvents

java.lang.Object
de.gurkenlabs.litiengine.input.GamepadEvents
Direct Known Subclasses:
Gamepad, GamepadManager

public abstract class GamepadEvents extends Object
The GamepadEvents class is the engine's implementation for receiving gamepad input events.
  • Field Details

  • Constructor Details

    • GamepadEvents

      protected GamepadEvents()
  • Method Details

    • onPoll

      public void onPoll(String identifier, GamepadEvents.GamepadPollListener listener)
      Adds the specified gamepad poll listener to receive events when the component with the defined identifier has been polled.
      Parameters:
      identifier - The component identifier for which to add the listener.
      listener - The listener to add.
    • removePollListener

      public void removePollListener(String identifier, GamepadEvents.GamepadPollListener listener)
      Unregister the specified poll listener from gamepad events.
      Parameters:
      identifier - The component identifier for which to remove the listener.
      listener - The listener to remove.
    • onPressed

      public void onPressed(String identifier, GamepadEvents.GamepadPressedListener listener)
      Adds the specified gamepad pressed listener to receive events when the component with the defined identifier has been pressed.
      Parameters:
      identifier - The component identifier for which to add the listener.
      listener - The listener to add.
    • removePressedListener

      public void removePressedListener(String identifier, GamepadEvents.GamepadPressedListener listener)
      Unregister the specified pressed listener from gamepad events.
      Parameters:
      identifier - The component identifier for which to remove the listener.
      listener - The listener to remove.
    • onReleased

      public void onReleased(String identifier, GamepadEvents.GamepadReleasedListener listener)
      Adds the specified gamepad released listener to receive events when the component with the defined identifier has been released.
      Parameters:
      identifier - The component identifier for which to add the listener.
      listener - The listener to add.
    • removeReleasedListener

      public void removeReleasedListener(String identifier, GamepadEvents.GamepadReleasedListener listener)
      Unregister the specified released listener from gamepad events.
      Parameters:
      identifier - The component identifier for which to remove the listener.
      listener - The listener to remove.
    • onPoll

      public void onPoll(GamepadEvents.GamepadPollListener listener)
      Adds the specified gamepad poll listener to receive events when any component has been polled.
      Parameters:
      listener - The listener to add.
    • removePollListener

      public void removePollListener(GamepadEvents.GamepadPollListener listener)
      Unregister the specified poll listener from gamepad events.
      Parameters:
      listener - The listener to remove.
    • onPressed

      public void onPressed(GamepadEvents.GamepadPressedListener listener)
      Adds the specified gamepad pressed listener to receive events when any component has been pressed.
      Parameters:
      listener - The listener to add.
    • removePressedListener

      public void removePressedListener(GamepadEvents.GamepadPressedListener listener)
      Unregister the specified pressed listener from gamepad events.
      Parameters:
      listener - The listener to remove.
    • onReleased

      public void onReleased(GamepadEvents.GamepadReleasedListener listener)
      Adds the specified gamepad released listener to receive events when any component has been released.
      Parameters:
      listener - The listener to add.
    • removeReleasedListener

      public void removeReleasedListener(GamepadEvents.GamepadReleasedListener listener)
      Unregister the specified released listener from gamepad events.
      Parameters:
      listener - The listener to remove.
    • clearEventListeners

      public void clearEventListeners()
      Removes all registered event listeners from the Gamepad instance.
    • isPressed

      public abstract boolean isPressed(String gamepadComponent)
      Determines whether the specified Gamepad component is currently pressed. This is useful for button type components.
      Parameters:
      gamepadComponent - The component to check against.
      Returns:
      True if the component is pressed, otherwise false.
      See Also: