|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.input.Actions
public class Actions
Title: Actions
Description: Keeps tracks of inputs from the mouse and keyboards and delegates them to listeners.
Copyright: Copyright (c) Oct 23, 2013
Field Summary | |
---|---|
static int |
ANY_KEY_ID
|
static int |
NUM_KEY_CODES
|
static int |
NUM_MOUSE_CODES
|
Constructor Summary | |
---|---|
Actions()
|
|
Actions(InputAction[] keySingleActions,
InputAction anyKeyActions,
InputMouseAction[] mouseActions)
|
Method Summary | |
---|---|
boolean |
addAnyKeyListener(InputListener listener)
|
boolean |
addMouseButtonListener(InputMouseListener listener,
InputMonitor.Mouse mouseEnum)
Takes an InputMouseListener and adds it to a mouse button action, to be notified when the mouse button is pressed. |
boolean |
addMouseMotionListener(InputMouseListener listener)
Takes an InputMouseListener and adds it to a mouse move action, to be notified when the mouse is moved. |
boolean |
addSingleKeyListener(InputListener listener,
int keyCode)
Takes an InputListener and adds it to a single key action, to be notified when the key is pressed. |
void |
clearAction(InputAction inputAction)
Deprecated. Not Used |
void |
clearMouseAction(InputMouseAction inputMouseAction)
Deprecated. Not Used |
void |
clearSingleKey(int keyCode)
Deprecated. Not Used |
InputAction |
getAnyKeyActions()
Deprecated. Not Used |
KeyPollMonitor |
getKeyPollMonitor()
Returns this instance of the KeyPollMonitor for Objects to use. |
protected InputAction |
getKeySingleAction(int keyCode)
Gets the InputAction that is linked to this single key event. |
protected InputMouseAction |
getMouseAction(int mouseCode)
Returns the InputMouseAction for the mouseCode |
void |
mapToMouse(InputMouseAction inputAction,
InputMonitor.Mouse mouseEnum)
Deprecated. Not used |
boolean |
removeAnyKeyListener(InputListener listener)
Removes an InputListener from the AnyKeyAction |
boolean |
removeMouseListener(InputMouseListener listener,
InputMonitor.Mouse mouseEnum)
This removes an InputMouseListener from the MouseList, for the Mouse enum entered. |
boolean |
removeSingleKeyListener(InputListener listener,
int keyCode)
This removes an InputListener from the Single Key List, for the key code entered. |
void |
resetAllInputActions()
Resets all the InputActions. |
void |
unwireInputListener(int keyID,
InputListener inputListener)
Wires in a key Listener into this action. |
void |
unwireInputMouseListener(InputMonitor.Mouse mouseAction,
InputMouseListener inputMouseListener)
Wires in a Mouse Listener into this action. |
void |
wireInputListener(int keyID,
InputListener inputListener)
Wires in a key Listener into this action. |
void |
wireInputMouseListener(InputMonitor.Mouse mouseAction,
InputMouseListener inputMouseListener)
Wires in a Mouse Listener into this action. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ANY_KEY_ID
public static final int NUM_KEY_CODES
public static final int NUM_MOUSE_CODES
Constructor Detail |
---|
public Actions()
public Actions(InputAction[] keySingleActions, InputAction anyKeyActions, InputMouseAction[] mouseActions)
Method Detail |
---|
public boolean addAnyKeyListener(InputListener listener)
listener
-
public boolean addSingleKeyListener(InputListener listener, int keyCode)
listener
- InputListenerkeyCode
- int
public boolean addMouseButtonListener(InputMouseListener listener, InputMonitor.Mouse mouseEnum)
listener
- InputMouseListenermouseEnum
- Mouse
public boolean addMouseMotionListener(InputMouseListener listener)
listener
- InputMouseListener
public void clearAction(InputAction inputAction)
inputAction
- InputActionpublic void clearMouseAction(InputMouseAction inputMouseAction)
inputMouseAction
- public void clearSingleKey(int keyCode)
keyCode
- intpublic InputAction getAnyKeyActions()
public KeyPollMonitor getKeyPollMonitor()
public void mapToMouse(InputMouseAction inputAction, InputMonitor.Mouse mouseEnum)
inputAction
- mouseEnum
- public boolean removeAnyKeyListener(InputListener listener)
listener
-
public boolean removeSingleKeyListener(InputListener listener, int keyCode)
listener
- InputListenerkeyCode
- int
public boolean removeMouseListener(InputMouseListener listener, InputMonitor.Mouse mouseEnum)
listener
- InputMouseListenermouseEnum
- Mouse
public void resetAllInputActions()
public void unwireInputListener(int keyID, InputListener inputListener)
keyID
- inputListener
- public void unwireInputMouseListener(InputMonitor.Mouse mouseAction, InputMouseListener inputMouseListener)
mouseAction
- inputMouseListener
- public void wireInputListener(int keyID, InputListener inputListener)
keyID
- inputListener
- public void wireInputMouseListener(InputMonitor.Mouse mouseAction, InputMouseListener inputMouseListener)
mouseAction
- inputMouseListener
- protected InputAction getKeySingleAction(int keyCode)
int
- keyCode
protected InputMouseAction getMouseAction(int mouseCode)
mouseCode
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |