com.jme.input
Class InputHandlerDevice

java.lang.Object
  extended by com.jme.input.InputHandlerDevice
Direct Known Subclasses:
JoystickInputHandlerDevice, KeyboardInputHandlerDevice, MouseInputHandlerDevice, UtilInputHandlerDevice

public abstract class InputHandlerDevice
extends java.lang.Object

Devices are used in InputHandler to create different types of ActionTriggers. The method createTriggers(com.jme.input.action.InputActionInterface, int, int, boolean, com.jme.input.InputHandler)(...) is called by InputHandler when actions are registered via InputHandler.addAction(com.jme.input.action.InputActionInterface,String,int,int,boolean).

See Also:
MouseInputHandlerDevice, KeyboardInputHandlerDevice, JoystickInputHandlerDevice

Constructor Summary
protected InputHandlerDevice(java.lang.String name)
           
 
Method Summary
protected abstract  void createTriggers(InputActionInterface action, int axis, int button, boolean allowRepeats, InputHandler inputHandler)
          Creates device specific trigger(s) for specified axes and buttons (the triggers register themselves at the inputHandler).
 java.lang.String getName()
          Query name of this device.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputHandlerDevice

protected InputHandlerDevice(java.lang.String name)
Parameters:
name - name of the device
Method Detail

getName

public final java.lang.String getName()
Query name of this device. Note: The name may not change, because it is used as key, that's why this method is final (avoid overrriding and returning another name).

Returns:
name of this device

createTriggers

protected abstract void createTriggers(InputActionInterface action,
                                       int axis,
                                       int button,
                                       boolean allowRepeats,
                                       InputHandler inputHandler)
Creates device specific trigger(s) for specified axes and buttons (the triggers register themselves at the inputHandler).

Parameters:
action - action that will be invoked upon trigger activation
axis - axis this trigger is responsible for
button - button this trigger is responsible for
allowRepeats - true to allow repeats
inputHandler - input handler for the triggers

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object