|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deken.game.input.KeyPollMonitor
public class KeyPollMonitor
Title: KeyPollMonitor
Description:
Copyright: Copyright (c) Dec 3, 2013
Constructor Summary | |
---|---|
KeyPollMonitor()
|
Method Summary | |
---|---|
java.lang.String |
getKeyCache()
Returns the keys typed |
java.lang.String |
getName()
|
boolean |
isAnyKeyDown()
In case you want to know if a user is pressing a key but don't care which one. |
boolean |
isAnyKeyUp()
In case you want to know if a user released a key but don't care which one. |
boolean |
isKeyDown(int key)
Returns true if the key (0-256) is being pressed use the KeyEvent.VK_ key variables to check specific keys. |
boolean |
isKeyUp(int key)
Returns true if the key (0-256) is being pressed use the KeyEvent.VK_ key variables to check specific keys. |
void |
processKeyPressed(java.awt.event.KeyEvent event)
Set the state elements for whatever key was pressed. |
void |
processKeyReleased(java.awt.event.KeyEvent e)
Set the state elements for whatever key was released. |
java.lang.String |
readKeyCache()
|
void |
update(long elapseTime)
Only resets the key state up because you don't want keys to be showing as up forever which is what will happen unless the array is cleared. |
void |
updateKeyCache(char c)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KeyPollMonitor()
Method Detail |
---|
public java.lang.String getKeyCache()
getKeyCache
in interface keyPolling
public boolean isKeyDown(int key)
isKeyDown
in interface keyPolling
key
- The ascii value of the keyboard key being checked
public boolean isKeyUp(int key)
isKeyUp
in interface keyPolling
key
- The ascii value of the keyboard key being checked
public boolean isAnyKeyDown()
isAnyKeyDown
in interface keyPolling
public boolean isAnyKeyUp()
isAnyKeyUp
in interface keyPolling
public void processKeyPressed(java.awt.event.KeyEvent event)
event
- public void processKeyReleased(java.awt.event.KeyEvent e)
e
- public java.lang.String readKeyCache()
readKeyCache
in interface keyPolling
public void update(long elapseTime)
update
in interface Updateable
elapseTime
- longpublic void updateKeyCache(char c)
public java.lang.String getName()
getName
in interface Updateable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |