at.wisch.joystick.event
Class ControllerButtonEvent

java.lang.Object
  extended by org.lwjgl.input.ControllerEvent
      extended by at.wisch.joystick.event.AdvancedControllerEvent
          extended by at.wisch.joystick.event.ControllerButtonEvent

public class ControllerButtonEvent
extends AdvancedControllerEvent

The Class ControllerButtonEvent. If this event occurs, it means that a button was pressed or released.

Author:
Martin Wischenbart
See Also:
ControllerEventManager

Field Summary
 
Fields inherited from class at.wisch.joystick.event.AdvancedControllerEvent
BALL, POV
 
Fields inherited from class org.lwjgl.input.ControllerEvent
AXIS, BUTTON, POVX, POVY
 
Constructor Summary
ControllerButtonEvent(Controller source, long timeStamp, int buttonIndex, boolean buttonState)
          Instantiates a new ControllerButtonEvent.
 
Method Summary
 boolean getButtonState()
          Gets the button state (true = pressed, false = released).
 java.lang.String toString()
          Returns a String describing the ControllerButtonEvent.
 
Methods inherited from class at.wisch.joystick.event.AdvancedControllerEvent
isBall, isPov, isPovX, isPovY, isXAxis, isYAxis
 
Methods inherited from class org.lwjgl.input.ControllerEvent
getControlIndex, getSource, getTimeStamp, isAxis, isButton
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ControllerButtonEvent

public ControllerButtonEvent(Controller source,
                             long timeStamp,
                             int buttonIndex,
                             boolean buttonState)
Instantiates a new ControllerButtonEvent.

Parameters:
source - the Controller that generated the event
timeStamp - the timestamp given for this event
buttonIndex - the index of the button that changed its state
buttonState - the button state (true = pressed, false = released)
Method Detail

getButtonState

public boolean getButtonState()
Gets the button state (true = pressed, false = released). Use getControlIndex() to get the button index.

Returns:
true, the if the button is now pressed. false, if it is now released.
See Also:
ControllerEvent.getControlIndex()

toString

public java.lang.String toString()
Returns a String describing the ControllerButtonEvent. This String contains the Joystick index, the button index and the new button state.

Specified by:
toString in class AdvancedControllerEvent
Returns:
a String describing the ControllerButtonEvent