com.jme.input.action
Class InputActionEvent

java.lang.Object
  extended by com.jme.input.action.InputActionEvent

public class InputActionEvent
extends java.lang.Object

InputActionEvent defines an event that generates the processing of a given InputAction. This event contains information about the triggers that caused the event to take places as well as the list of names of the other Actions that were to be processed at the same time.

Version:
$Id: InputActionEvent.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell

Constructor Summary
InputActionEvent()
          instantiates a default InputActionEvent object.
 
Method Summary
 float getTime()
          returns the time the event occured.
 boolean getTriggerAllowsRepeats()
           
 char getTriggerCharacter()
           
 java.lang.Object getTriggerData()
           
 float getTriggerDelta()
           
 java.lang.String getTriggerDevice()
          name of the device that triggered this event, null if not applicable
 int getTriggerIndex()
           
 java.lang.String getTriggerName()
          Usually triggerName is set to a button/axis name or command.
 float getTriggerPosition()
           
 boolean getTriggerPressed()
           
 void setTime(float time)
          sets the time the event occured.
 void setTriggerAllowsRepeats(boolean value)
           
 void setTriggerCharacter(char value)
           
 void setTriggerData(java.lang.Object value)
           
 void setTriggerDelta(float value)
           
 void setTriggerDevice(java.lang.String value)
           
 void setTriggerIndex(int value)
           
 void setTriggerName(java.lang.String value)
           
 void setTriggerPosition(float value)
           
 void setTriggerPressed(boolean value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputActionEvent

public InputActionEvent()
instantiates a default InputActionEvent object. The keys, eventList and time are set to null or 0.

Method Detail

getTime

public float getTime()
returns the time the event occured.

Returns:
Returns the time.

setTime

public void setTime(float time)
sets the time the event occured.

Parameters:
time - The time to set.

getTriggerName

public java.lang.String getTriggerName()
Usually triggerName is set to a button/axis name or command.

Returns:
current value of field triggerName

setTriggerName

public void setTriggerName(java.lang.String value)
Parameters:
value - new value

getTriggerCharacter

public char getTriggerCharacter()
Returns:
some character data associated with the event / button name, '\0' if not applicable.
example: typed keyboard character

setTriggerCharacter

public void setTriggerCharacter(char value)
Parameters:
value - new value
See Also:
getTriggerCharacter()

getTriggerDevice

public java.lang.String getTriggerDevice()
name of the device that triggered this event, null if not applicable

Returns:
current value of field axisName

setTriggerDevice

public void setTriggerDevice(java.lang.String value)
Parameters:
value - new value
See Also:
getTriggerDevice()

getTriggerIndex

public int getTriggerIndex()
Returns:
index of the device part that caused the event, -1 if not applicable
example: mouse button index, joystick axis index

setTriggerIndex

public void setTriggerIndex(int value)
Parameters:
value - new value
See Also:
getTriggerIndex()

getTriggerPosition

public float getTriggerPosition()
Returns:
new position of the device part that caused the event, default 0, range [-1;1]
example: joystick axis position

setTriggerPosition

public void setTriggerPosition(float value)
Parameters:
value - new value
See Also:
getTriggerPosition()

getTriggerDelta

public float getTriggerDelta()
Returns:
position delta of the device part that caused the event, default 0, range [-1;1]
example: joystick axis delta

setTriggerDelta

public void setTriggerDelta(float value)
Parameters:
value - new value
See Also:
getTriggerDelta()

getTriggerPressed

public boolean getTriggerPressed()
Returns:
true if a button was pressed, false if released, default: false
example: true if joystick button is pressed, false if joystick button is released

setTriggerPressed

public void setTriggerPressed(boolean value)
Parameters:
value - new value
See Also:
getTriggerPressed()

getTriggerAllowsRepeats

public boolean getTriggerAllowsRepeats()
Returns:
true if the trigger that caused the event allows repeats
See Also:
InputHandler.addAction(InputActionInterface,String,int,int,boolean)

setTriggerAllowsRepeats

public void setTriggerAllowsRepeats(boolean value)
Parameters:
value - new value
See Also:
getTriggerAllowsRepeats()

getTriggerData

public java.lang.Object getTriggerData()
Returns:
some data data associated with the event, null if not applicable.

setTriggerData

public void setTriggerData(java.lang.Object value)
Parameters:
value - new value
See Also:
getTriggerData()