|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrlgamekit.control.KeyInputHandler
public class KeyInputHandler
The KeyInputHandler calls game actions which are triggered by key events.
GameAction| Constructor Summary | |
|---|---|
KeyInputHandler()
Craetes a new KeyInputHandler with an empty list of actions. |
|
| Method Summary | |
|---|---|
void |
addAction(ActionKey key,
GameAction action)
Add a new game action for the given key binding. |
GameAction |
getAction(ActionKey key)
Get the action bound to the key event. |
java.util.Set<ActionKey> |
getKeys()
Get a set of all defined action keys. |
void |
keyPressed(java.awt.event.KeyEvent e)
Implements KeyListener, calls onKeyPressed() for matching actions |
void |
keyReleased(java.awt.event.KeyEvent e)
Implements KeyListener, calls onKeyRelease() for matching actions |
void |
keyTyped(java.awt.event.KeyEvent e)
Implements KeyListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public KeyInputHandler()
| Method Detail |
|---|
public void addAction(ActionKey key,
GameAction action)
action - The game action to add.key - The key to bind the action to.public GameAction getAction(ActionKey key)
key - The action key
public java.util.Set<ActionKey> getKeys()
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||