com.jme.input.util
Class SyntheticButton
java.lang.Object
com.jme.input.util.SyntheticTriggerContainer
com.jme.input.util.SyntheticButton
public class SyntheticButton
- extends SyntheticTriggerContainer
This class can be used to create synthetic buttons for InputHandler
s. As an example see TwoButtonAxis
.
Field Summary |
protected java.lang.String |
name
name of this button. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
name
protected final java.lang.String name
- name of this button.
SyntheticButton
public SyntheticButton(java.lang.String name)
getName
public java.lang.String getName()
- Specified by:
getName
in class SyntheticTriggerContainer
- Returns:
- the name of this button
getIndex
public int getIndex()
- Specified by:
getIndex
in class SyntheticTriggerContainer
- Returns:
- index of this button/axis (used when registering with InputHandler)
- See Also:
SyntheticTriggerContainer.getDeviceName()
setIndex
void setIndex(int value)
- setter for field button
- Parameters:
value
- index of this button
getDeviceName
public final java.lang.String getDeviceName()
- Specified by:
getDeviceName
in class SyntheticTriggerContainer
- Returns:
- name of the virtual device this button/axis is attached to (used when registering with InputHandler)
- See Also:
SyntheticTriggerContainer.getIndex()
createTrigger
protected void createTrigger(InputHandler inputHandler,
InputActionInterface action,
boolean allowRepeats)
add
void add(SyntheticTrigger trigger)
- Specified by:
add
in class SyntheticTriggerContainer
- Parameters:
trigger
- what to add to list of triggers
remove
void remove(SyntheticTrigger trigger)
- Specified by:
remove
in class SyntheticTriggerContainer
- Parameters:
trigger
- what to remove from list of triggers
trigger
public void trigger(float delta,
char character,
float value,
boolean pressed,
java.lang.Object data)