org.lwjgl.input
Class ControllerEvent

java.lang.Object
  extended by org.lwjgl.input.ControllerEvent
Direct Known Subclasses:
AdvancedControllerEvent

public abstract class ControllerEvent
extends java.lang.Object

An event occuring on a controller.

Author:
Kevin Glass --- javadoc comments extended and modifiers added by Martin Wischenbart for http://sourceforge.net/projects/ffjoystick4java/

Field Summary
static int AXIS
          Indicates the event was caused by an analogue axis: the object is a ControllerAxisEvent (casting is safe).
static int BUTTON
          Indicates the event was caused by a button: the object is a ControllerButtonEvent (casting is safe).
static int POVX
          Indicates the event was caused by a POV's X axis: the object is a ControllerPovEvent (casting is safe).
static int POVY
          Indicates the event was caused by a POV's Y axis: the object is a ControllerPovEvent (casting is safe).
 
Method Summary
 int getControlIndex()
          Get the index of the control generating this event.
 Controller getSource()
          Get the Controller that generated this event.
 long getTimeStamp()
          Get the time stamp for this event.
 boolean isAxis()
          Check if this event was generated by an axis.
 boolean isButton()
          Check if this event was generated by a button.
 boolean isPovX()
          Check if this event was generated by a POV's X axis.
 boolean isPovY()
          Check if this event was generated by a POV's Y axis.
 boolean isXAxis()
          Check if this event was caused by the X axis.
 boolean isYAxis()
          Check if this event was caused by the Y axis.
 java.lang.String toString()
          Returns a String describing the ControllerEvent.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BUTTON

public static final int BUTTON
Indicates the event was caused by a button: the object is a ControllerButtonEvent (casting is safe).

See Also:
Constant Field Values

AXIS

public static final int AXIS
Indicates the event was caused by an analogue axis: the object is a ControllerAxisEvent (casting is safe).

See Also:
Constant Field Values

POVX

public static final int POVX
Indicates the event was caused by a POV's X axis: the object is a ControllerPovEvent (casting is safe).

See Also:
Constant Field Values

POVY

public static final int POVY
Indicates the event was caused by a POV's Y axis: the object is a ControllerPovEvent (casting is safe).

See Also:
Constant Field Values
Method Detail

getTimeStamp

public long getTimeStamp()
Get the time stamp for this event. This value is used to give the events an order.

Returns:
he timestamp given for this event

getSource

public Controller getSource()
Get the Controller that generated this event.

Returns:
the Controller object that generated this event

getControlIndex

public int getControlIndex()
Get the index of the control generating this event.

Returns:
the index of the control generating this event (e.g. axis index, button index, ...)

isButton

public boolean isButton()
Check if this event was generated by a button.

Returns:
true, if this event was generated by a button. false, otherwise.

isAxis

public boolean isAxis()
Check if this event was generated by an axis.

Returns:
true, if this event was generated by an axis. false, otherwise.

isPovX

public boolean isPovX()
Check if this event was generated by a POV's X axis.

Returns:
true, if this event was generated by a POV's X axis. false, otherwise.

isPovY

public boolean isPovY()
Check if this event was generated by a POV's Y axis.

Returns:
true, if this event was generated by a POV's Y axis. false, otherwise.

isXAxis

public boolean isXAxis()
Check if this event was caused by the X axis.

Returns:
true, if this event was caused by the X axis. false, otherwise.

isYAxis

public boolean isYAxis()
Check if this event was caused by the Y axis.

Returns:
true, if this event was caused by the Y axis. false, otherwise.

toString

public java.lang.String toString()
Returns a String describing the ControllerEvent. This String contains: the source Controller, type constant and booleans xaxis and yaxis.

Overrides:
toString in class java.lang.Object
Returns:
a String describing the ControllerEvent