|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.input.InputMonitor
public class InputMonitor
Title: InputMonitor
Description: Manager for handling user input from Mouse and Keyboard.
Copyright: Copyright (c) 2005
Nested Class Summary | |
---|---|
static class |
InputMonitor.Mouse
|
Method Summary | |
---|---|
static boolean |
addAnyKeyListener(InputListener listener)
|
static boolean |
addMouseButtonListener(InputMouseListener listener,
InputMonitor.Mouse mouseEnum)
addMouseButtonListener Takes an InputMouseListener and adds it to a mouse button action, to be notified when the mouse button is pressed. |
static boolean |
addMouseMotionListener(InputMouseListener listener)
addMotionListener Takes an InputMouseListener and adds it to a mouse move action, to be notified when the mouse is moved. |
static boolean |
addSingleKeyListener(InputListener listener,
int keyCode)
addKeyListener Takes an InputListener and adds it to a single key action, to be notified when the key is pressed. |
void |
clearMap(InputAction inputAction)
Deprecated. Not used |
void |
clearSingleKey(int keyCode)
Deprecated. Not used |
static InputAction |
getInputActionForKey(int keyCode,
java.lang.String name)
getInputActionForKey Creates an InputAction with the given name and default key behavior, and maps it to the given key code. |
static InputMouseAction |
getInputMouseActionForCode(InputMonitor.Mouse mouseEnum)
getInputMouseActionForCode Creates an InputMouseAction with the given name and default behavior, and maps it to the given Mouse enum. |
static InputMonitor |
getInstance()
getInstance This class is a singleton, allowing inputs to be monitored by one object. |
static InputMonitor |
getInstance(java.awt.Component component)
getInstance This class is a singleton, allowing inputs to be monitored by one object. |
KeyPollMonitor |
getKeyPollMonitor()
|
void |
mapToMouse(InputMouseAction inputAction,
InputMonitor.Mouse mouseEnum)
Deprecated. Not used |
void |
registerKeyMultiListener(InputListener inputListener)
registerKeyMultiListener This registers a new InputListener to the KeyMulitList |
void |
removeActions()
Removes the specific Actions, and restores the Global Actions. |
static boolean |
removeAnyKeyListener(InputListener listener)
|
void |
removeKeyMultiListener(InputListener inputListener)
removeKeyMultiListener This removes an InputListener from the KeyMultiList. |
static boolean |
removeMouseButtonListener(InputMouseListener listener,
InputMonitor.Mouse mouseEnum)
removeMouseButtonListener This removes an InputMouseListener from the MouseList, for the Mouse enum entered. |
static boolean |
removeMouseMotionListener(InputMouseListener listener,
InputMonitor.Mouse mouseEnum)
removeMouseMotionListener This removes an InputMouseListener from the Mouse Motion List. |
static boolean |
removeSingleKeyListener(InputListener listener,
int keyCode)
removeSingleKeyListener This removes an InputListener from the Single Key List, for the key code entered. |
void |
resetAllInputActions()
resetAllInputActions Resets all Input actions as if they have not been activated. |
void |
setActions(Actions actions)
|
void |
setSource(java.awt.Component component)
setSource This needs to be set if the source of all event should come from a component within the Frame or Window. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static InputMonitor getInstance()
public static InputMonitor getInstance(java.awt.Component component)
component
- Component
public static boolean addAnyKeyListener(InputListener listener)
public static boolean addSingleKeyListener(InputListener listener, int keyCode)
listener
- InputListenerkeyCode
- int
public static boolean addMouseButtonListener(InputMouseListener listener, InputMonitor.Mouse mouseEnum)
listener
- InputMouseListenermouseEnum
- Mouse
public static boolean addMouseMotionListener(InputMouseListener listener)
listener
- InputMouseListener
public static boolean removeAnyKeyListener(InputListener listener)
public static boolean removeSingleKeyListener(InputListener listener, int keyCode)
listener
- InputListenerkeyCode
- int
public static boolean removeMouseButtonListener(InputMouseListener listener, InputMonitor.Mouse mouseEnum)
listener
- InputMouseListenermouseEnum
- Mouse
public static boolean removeMouseMotionListener(InputMouseListener listener, InputMonitor.Mouse mouseEnum)
listener
- InputMouseListenermouseEnum
- Mouse
public static InputAction getInputActionForKey(int keyCode, java.lang.String name)
keyCode
- int Use KeyEvent to get key code.name
- String
public static InputMouseAction getInputMouseActionForCode(InputMonitor.Mouse mouseEnum)
mouseEnum
- Mouse
public void clearMap(InputAction inputAction)
inputAction
- InputActionpublic void clearSingleKey(int keyCode)
keyCode
- intpublic KeyPollMonitor getKeyPollMonitor()
public void mapToMouse(InputMouseAction inputAction, InputMonitor.Mouse mouseEnum)
inputAction
- InputActionmouseEnum
- Mousepublic void registerKeyMultiListener(InputListener inputListener)
inputListener
- InputListenerpublic void removeKeyMultiListener(InputListener inputListener)
inputListener
- InputListenerpublic void removeActions()
public void resetAllInputActions()
public void setActions(Actions actions)
actions
- public void setSource(java.awt.Component component)
component
- Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |