com.threed.jpct.util
Class KeyState

java.lang.Object
  extended bycom.threed.jpct.util.KeyState

public class KeyState
extends java.lang.Object

A KeyState is similar to the AWT KeyEvent and will be returned by the poll()-method of the KeyMapper.


Field Summary
static KeyState NONE
          This will be returned by poll() if the queue is empty.
static boolean PRESSED
          The key has been pressed
static boolean RELEASED
          The key has been released
 
Method Summary
 char getChar()
          The key's character for the key that has been pressed or release.
 int getKeyCode()
          The key code for the key that has been pressed or release.
 boolean getState()
          The state of the key of this KeyState, i.e. pressed or released.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRESSED

public static final boolean PRESSED
The key has been pressed

See Also:
Constant Field Values

RELEASED

public static final boolean RELEASED
The key has been released

See Also:
Constant Field Values

NONE

public static final KeyState NONE
This will be returned by poll() if the queue is empty.

Method Detail

getState

public boolean getState()
The state of the key of this KeyState, i.e. pressed or released.

Returns:
boolean the state

getKeyCode

public int getKeyCode()
The key code for the key that has been pressed or release. This is the same code that an AWT KeyEvent would return. This value doesn't depend on the actual keyboard layout.

Returns:
int the key code
See Also:
KeyEvent

getChar

public char getChar()
The key's character for the key that has been pressed or release. This value depends on the actual keyboard layout.

Returns:
char the character
See Also:
KeyEvent