com.jme.input.action
Class KeyInputAction

java.lang.Object
  extended bycom.jme.input.action.KeyInputAction
All Implemented Interfaces:
InputAction
Direct Known Subclasses:
KeyBackwardAction, KeyExitAction, KeyForwardAction, KeyLookDownAction, KeyLookUpAction, KeyNodeBackwardAction, KeyNodeForwardAction, KeyNodeLookDownAction, KeyNodeLookUpAction, KeyNodeRotateLeftAction, KeyNodeRotateRightAction, KeyNodeStrafeLeftAction, KeyNodeStrafeRightAction, KeyRotateLeftAction, KeyRotateRightAction, KeyScreenShotAction, KeyStrafeLeftAction, KeyStrafeRightAction, KeyToggleBoolean, KeyToggleRenderState, TestNodeSelectionAction, UIEditBox.EditBoxKeyInputAction

public abstract class KeyInputAction
extends java.lang.Object
implements InputAction

InputAction defines an interface for creating input actions. These actions can correspond to any event defined by a key value. The InputHandler class typically maintains a collection of the actions and when required calls the actions performAction method.

Version:
$Id: KeyInputAction.java,v 1.1 2004/10/14 01:22:59 mojomonkey Exp $
Author:
Mark Powell
See Also:
InputHandler

Field Summary
protected  boolean allowsRepeats
          If true, a single button press results in multiple calls to this class's performAction(float)
protected  java.lang.String key
          A name that identifies this action.
protected  char keyChar
          The char associated with this event.
protected  float speed
          A speed value that, if desired, can change how actions are performed.
 
Constructor Summary
KeyInputAction()
           
 
Method Summary
 boolean allowsRepeats()
          Returns true if a single key press is set to allow repeated performAction calls.
 java.lang.String getKey()
          getKey retrieves the key associated with this action.
 char getKeyChar()
          getKey retrieves the key associated with this action.
 float getSpeed()
          Returns the currently set speed.
 void setAllowsRepeats(boolean allow)
          Sets if a single key press allows repeated performAction calls.
 void setKey(java.lang.String key)
          setKey sets the key associated with this action.
 void setKeyChar(char keyChar)
          setKey sets the key associated with this action.
 void setSpeed(float speed)
          setSpeed defines the speed at which this action occurs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jme.input.action.InputAction
performAction
 

Field Detail

allowsRepeats

protected boolean allowsRepeats
If true, a single button press results in multiple calls to this class's performAction(float)


speed

protected float speed
A speed value that, if desired, can change how actions are performed.


key

protected java.lang.String key
A name that identifies this action.


keyChar

protected char keyChar
The char associated with this event.

Constructor Detail

KeyInputAction

public KeyInputAction()
Method Detail

setSpeed

public void setSpeed(float speed)
setSpeed defines the speed at which this action occurs.

Specified by:
setSpeed in interface InputAction
Parameters:
speed - the speed at which this action occurs.

getSpeed

public float getSpeed()
Returns the currently set speed. Speed is 0 by default.

Specified by:
getSpeed in interface InputAction
Returns:
The current speed.

getKey

public java.lang.String getKey()
getKey retrieves the key associated with this action.

Specified by:
getKey in interface InputAction
Returns:
the key associated with the action.

setKey

public void setKey(java.lang.String key)
setKey sets the key associated with this action.

Specified by:
setKey in interface InputAction
Parameters:
key - the key associated with the action.

getKeyChar

public char getKeyChar()
getKey retrieves the key associated with this action.

Returns:
the key associated with the action.

setKeyChar

public void setKeyChar(char keyChar)
setKey sets the key associated with this action.


allowsRepeats

public boolean allowsRepeats()
Returns true if a single key press is set to allow repeated performAction calls.

Returns:
The current repeat state.

setAllowsRepeats

public void setAllowsRepeats(boolean allow)
Sets if a single key press allows repeated performAction calls.

Parameters:
allow - If true, a single key press allows fo repeated performAction calls.