Class GamepadEvent

java.lang.Object
java.util.EventObject
de.gurkenlabs.litiengine.input.GamepadEvent
All Implemented Interfaces:
java.io.Serializable

public class GamepadEvent
extends java.util.EventObject
See Also:
Serialized Form
  • Field Summary

    Fields inherited from class java.util.EventObject

    source
  • Method Summary

    Modifier and TypeMethodDescription
    java.lang.StringgetComponent()
    Gets the identifier of the component that caused this event.
    GamepadgetGamepad()
    Gets the gamepad that caused the event.
    floatgetValue()
    Gets the data from the last time the component has been polled.
    booleanisAnalog()
    Returns whether or not the axis is analog, or false if it is digital.
    booleanisRelative()
    Returns true if data returned from poll is relative to the last call, or false if data is absolute.

    Methods inherited from class java.util.EventObject

    getSource, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • getValue

      public float getValue()
      Gets the data from the last time the component has been polled. If this axis is a button, the value returned will be either 0.0f or 1.0f. If this axis is normalized, the value returned will be between -1.0f and 1.0f.
      Returns:
      The last poll value of the component of this event.
    • getComponent

      public java.lang.String getComponent()
      Gets the identifier of the component that caused this event.
      Returns:
      The human-readable name of the component.
    • getGamepad

      public Gamepad getGamepad()
      Gets the gamepad that caused the event.
      Returns:
      The gamepad of this event.
    • isRelative

      public boolean isRelative()
      Returns true if data returned from poll is relative to the last call, or false if data is absolute.
      Returns:
      True if the data is relative; otherwise false.
    • isAnalog

      public boolean isAnalog()
      Returns whether or not the axis is analog, or false if it is digital.
      Returns:
      True if the component is analog; otherwise false.