org.jagatoo.input.managers
Class SimpleInputActionManager
java.lang.Object
org.jagatoo.input.managers.SimpleInputActionManager
- All Implemented Interfaces:
- InputStateListener
public class SimpleInputActionManager
- extends java.lang.Object
- implements InputStateListener
The SimpleInputActionManager can be used to bind
input DeviceComponents to simple input-actions (like Strings).
You need to add it to the InputSystem or one of its registered
InputDevices as an InputStateListener to make it work.
You can use it as a singleton. The singleton instance is always automatically
added to the InputSystem as a listener.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleInputActionManager
public SimpleInputActionManager()
getInstance
public static final SimpleInputActionManager getInstance()
addActionListener
public void addActionListener(SimpleInputActionListener l)
removeActionListener
public void removeActionListener(SimpleInputActionListener l)
getNumBoundActions
public final int getNumBoundActions()
bindAction
public void bindAction(DeviceComponent comp,
java.lang.Object action)
unbindAction
public void unbindAction(DeviceComponent comp)
unbindAction
public void unbindAction(java.lang.Object action)
getBoundAction
public final java.lang.Object getBoundAction(DeviceComponent comp)
notifyListeners
protected void notifyListeners(java.lang.Object action,
int delta,
int state)
onInputStateChanged
public void onInputStateChanged(InputEvent e,
DeviceComponent comp,
int delta,
int state)
- Description copied from interface:
InputStateListener
- This event is fired, if an input device of any kind changed its state.
- Specified by:
onInputStateChanged in interface InputStateListener
- Parameters:
e - the abstract event, that was triggered.comp - the DeviceComponent, that is responsible for this eventdelta - the delta informationstate - the absolute state