net.ctdp.rfdynhud.input
Class InputAction

java.lang.Object
  extended by net.ctdp.rfdynhud.input.InputAction
All Implemented Interfaces:
java.lang.Comparable<InputAction>

public class InputAction
extends java.lang.Object
implements java.lang.Comparable<InputAction>

This is a simple abstraction of an input action.

Author:
Marvin Froehlich (CTDP)

Field Summary
static int MODIFIER_MASK_CTRL
           
static int MODIFIER_MASK_LALT
           
static int MODIFIER_MASK_LMETA
           
static int MODIFIER_MASK_RALT
           
static int MODIFIER_MASK_RMETA
           
static int MODIFIER_MASK_SHIFT
           
 
Constructor Summary
InputAction(java.lang.String name)
          Creates a new InputAction.
InputAction(java.lang.String name, java.lang.Boolean acceptedState)
          Creates a new InputAction.
 
Method Summary
 boolean acceptsState(boolean state)
           
 int compareTo(InputAction o)
          
 boolean equals(java.lang.Object o)
          
 java.lang.Boolean getAcceptedState()
           
 InputActionConsumer getConsumer()
           
 java.lang.String getDoc()
           
 int getID()
           
 java.lang.String getName()
           
 int hashCode()
          
 boolean isWidgetAction()
           
 java.lang.String toString()
          
 java.lang.String toString2()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MODIFIER_MASK_SHIFT

public static final int MODIFIER_MASK_SHIFT
See Also:
Constant Field Values

MODIFIER_MASK_CTRL

public static final int MODIFIER_MASK_CTRL
See Also:
Constant Field Values

MODIFIER_MASK_LALT

public static final int MODIFIER_MASK_LALT
See Also:
Constant Field Values

MODIFIER_MASK_RALT

public static final int MODIFIER_MASK_RALT
See Also:
Constant Field Values

MODIFIER_MASK_LMETA

public static final int MODIFIER_MASK_LMETA
See Also:
Constant Field Values

MODIFIER_MASK_RMETA

public static final int MODIFIER_MASK_RMETA
See Also:
Constant Field Values
Constructor Detail

InputAction

public InputAction(java.lang.String name,
                   java.lang.Boolean acceptedState)
Creates a new InputAction. The acceptedState defines, whether an input state change event is fired only for key pressed, key released or both.

Parameters:
name - the action's name as displayed in the editor
acceptedState - null to accept any state, true or false to accept only this state. Widget.onBoundInputStateChanged(InputAction, boolean, int, long, net.ctdp.rfdynhud.gamedata.LiveGameData, boolean) will only be fired for the accepted states.

InputAction

public InputAction(java.lang.String name)
Creates a new InputAction. It will only accept true state, so the Widget.onBoundInputStateChanged(InputAction, boolean, int, long, net.ctdp.rfdynhud.gamedata.LiveGameData, boolean) event will only be fired when the key/button is pressed while released state changes will be ignored.

Parameters:
name - the action's name as displayed in the editor
Method Detail

getID

public final int getID()

getName

public final java.lang.String getName()

getAcceptedState

public final java.lang.Boolean getAcceptedState()

acceptsState

public final boolean acceptsState(boolean state)

isWidgetAction

public final boolean isWidgetAction()

getConsumer

public final InputActionConsumer getConsumer()

getDoc

public final java.lang.String getDoc()

compareTo

public int compareTo(InputAction o)

Specified by:
compareTo in interface java.lang.Comparable<InputAction>

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

toString2

public java.lang.String toString2()