com.jme.input
Class ActionTrigger.CommandTrigger

java.lang.Object
  extended by com.jme.input.ActionTrigger
      extended by com.jme.input.ActionTrigger.CommandTrigger
Enclosing class:
ActionTrigger

static class ActionTrigger.CommandTrigger
extends ActionTrigger

Trigger implementation for using KeyBindingManager as trigger.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.input.ActionTrigger
ActionTrigger.CommandTrigger
 
Field Summary
 
Fields inherited from class com.jme.input.ActionTrigger
action, allowRepeats, inputHandler, name
 
Constructor Summary
protected ActionTrigger.CommandTrigger(InputHandler handler, java.lang.String triggerName, InputActionInterface action, boolean allowRepeats)
           
 
Method Summary
 void checkActivation(char character, int index, float position, float delta, boolean pressed, java.lang.Object data)
          Invoked to activate or deactivate a trigger on specific event.
protected  java.lang.String getDeviceName()
           
 void performAction(InputActionEvent event)
          Perform the action and deactivate the trigger if it does not allow repeats.
 
Methods inherited from class com.jme.input.ActionTrigger
activate, deactivate, getActionInvocationCount, getNext, getPrevious, isActive, putTriggerInfo, remove, setNext, setPrevious
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionTrigger.CommandTrigger

protected ActionTrigger.CommandTrigger(InputHandler handler,
                                       java.lang.String triggerName,
                                       InputActionInterface action,
                                       boolean allowRepeats)
Method Detail

performAction

public void performAction(InputActionEvent event)
Description copied from class: ActionTrigger
Perform the action and deactivate the trigger if it does not allow repeats.

Overrides:
performAction in class ActionTrigger
Parameters:
event - info about the event that caused the action

checkActivation

public void checkActivation(char character,
                            int index,
                            float position,
                            float delta,
                            boolean pressed,
                            java.lang.Object data)
Description copied from class: ActionTrigger
Invoked to activate or deactivate a trigger on specific event. The data in the parameters depend on the kind of trigger. Defaults for each parameter (set if value for parameter is unknown or not applicable) are given below. The trigger should activate or deactivate itself if appropriate.

Specified by:
checkActivation in class ActionTrigger
Parameters:
character - some character data associated with the event, default '\0'.
example: keyboard character
index - index of the device part that caused the event, default -1, >= 0 if valid
example: mouse button index, joystick axis index
position - new position of the device part that caused the event, default NaN, common range [-1;1]
example: joystick axis position
delta - position delta of the device part that caused the event, default NaN, common range [-1;1]
example: joystick axis delta
pressed - indicates if a button was pressed or released, default: false
example: true if joystick button is pressed, false if joystick button is released
data - any trigger specific data
example: joystick triggers get the Joystick instance for fast comparison
See Also:
ActionTrigger.activate(), ActionTrigger.deactivate()

getDeviceName

protected java.lang.String getDeviceName()
Specified by:
getDeviceName in class ActionTrigger
Returns:
name of the device this trigger belongs to