at.wisch.joystick.event
Class ControllerButtonEvent
java.lang.Object
org.lwjgl.input.ControllerEvent
at.wisch.joystick.event.AdvancedControllerEvent
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
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ControllerButtonEvent
public ControllerButtonEvent(Controller source,
long timeStamp,
int buttonIndex,
boolean buttonState)
- Instantiates a new ControllerButtonEvent.
- Parameters:
source
- the Controller that generated the eventtimeStamp
- the timestamp given for this eventbuttonIndex
- the index of the button that changed its statebuttonState
- the button state (true = pressed, false = released)
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