com.jme.input.util
Class SyntheticTrigger
java.lang.Object
com.jme.input.ActionTrigger
com.jme.input.util.SyntheticTrigger
class SyntheticTrigger
- extends ActionTrigger
trigger for simulating button
Method Summary |
void |
checkActivation(char character,
int buttonIndex,
float position,
float delta,
boolean pressed,
java.lang.Object data)
Invoked to activate or deactivate a trigger on specific event. |
protected int |
getActionInvocationCount()
|
protected java.lang.String |
getDeviceName()
|
void |
performAction(InputActionEvent event)
Perform the action and deactivate the trigger if it does not allow repeats. |
protected void |
putTriggerInfo(InputActionEvent event,
int invocationIndex)
Called by InputHandler to fill info about the trigger into an event. |
protected void |
remove()
Remove this trigger. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SyntheticTrigger
public SyntheticTrigger(SyntheticTriggerContainer container,
InputHandler handler,
InputActionInterface action,
boolean allowRepeats,
boolean permanentlyActiveIfRepeats)
getActionInvocationCount
protected int getActionInvocationCount()
- Overrides:
getActionInvocationCount
in class ActionTrigger
- Returns:
- the number of times the action should be invoked if triggered
remove
protected void remove()
- Description copied from class:
ActionTrigger
- Remove this trigger.
- Overrides:
remove
in class ActionTrigger
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
putTriggerInfo
protected void putTriggerInfo(InputActionEvent event,
int invocationIndex)
- Description copied from class:
ActionTrigger
- Called by InputHandler to fill info about the trigger into an event. Commonly overwritten by trigger
implementations to provide additional info.
- Overrides:
putTriggerInfo
in class ActionTrigger
- Parameters:
event
- where to put the informationinvocationIndex
- index to distinct multiple action invocations per trigger activation- See Also:
ActionTrigger.getActionInvocationCount()
getDeviceName
protected final java.lang.String getDeviceName()
- Specified by:
getDeviceName
in class ActionTrigger
- Returns:
- name of the device this trigger belongs to
checkActivation
public void checkActivation(char character,
int buttonIndex,
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 characterbuttonIndex
- index of the device part that caused the event, default -1, >= 0 if valid
example: mouse button index, joystick axis indexposition
- new position of the device part that caused the event, default NaN, common range [-1;1]
example: joystick axis positiondelta
- position delta of the device part that caused the event, default NaN, common range [-1;1]
example: joystick axis deltapressed
- indicates if a button was pressed or released, default: false
example: true if joystick button is pressed, false if joystick button is releaseddata
- any trigger specific data
example: joystick triggers get the Joystick instance for fast comparison- See Also:
ActionTrigger.activate()
,
ActionTrigger.deactivate()