Package de.gurkenlabs.litiengine.input
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
Method Summary
Modifier and Type Method Description java.lang.String
getComponent()
Gets the identifier of the component that caused this event.Gamepad
getGamepad()
Gets the gamepad that caused the event.float
getValue()
Gets the data from the last time the component has been polled.boolean
isAnalog()
Returns whether or not the axis is analog, or false if it is digital.boolean
isRelative()
Returnstrue
if data returned frompoll
is relative to the last call, orfalse
if data is absolute.
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
Gets the gamepad that caused the event.- Returns:
- The gamepad of this event.
isRelative
public boolean isRelative()Returnstrue
if data returned frompoll
is relative to the last call, orfalse
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.