public class InputControl
extends java.lang.Object
InputListener
(e.g., an ActionListener
or an
AnalogListener
)Trigger
s per mapping name
This class provides a wrapper for these components and handles registration
with an Application
's InputManager
.
Note: A single InputControl
cannot be registered with
more than one InputManager
at a time.
Constructor and Description |
---|
InputControl(com.jme3.input.controls.InputListener listener,
java.lang.String... mappingNames)
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addTriggers(java.lang.String mappingName,
com.jme3.input.controls.Trigger... triggers)
Adds
Trigger s for the specified mapping names. |
void |
registerWithInput(com.jme3.input.InputManager input)
Registers the control with the specified
InputManager . |
void |
unregisterFromInput()
Unregisters the control from its current
InputManager . |
public InputControl(com.jme3.input.controls.InputListener listener, java.lang.String... mappingNames)
listener
- The InputListener
that will be called when one of
the mappings
is triggered. This is typically an
ActionListener
or AnalogListener
.mappingNames
- The expected mapping names for the listener.public void addTriggers(java.lang.String mappingName, com.jme3.input.controls.Trigger... triggers)
Trigger
s for the specified mapping names. Does nothing
if either argument is null
.mappingName
- The name of the mapping that will be triggered.triggers
- The Trigger
s that will cause an event with the
mapping name to be passed to the InputControl
's
InputListener
.public void registerWithInput(com.jme3.input.InputManager input)
InputManager
. The
InputControl
can only be registered with one
InputManager
at a time.input
- The InputManager
to register with.public void unregisterFromInput()
InputManager
.