com.b3dgs.lionengine.input
Interface Keyboard


public interface Keyboard

Represents the keyboard input. Gives informations such as pressed key and code.


Field Summary
static int ALT
          ALT key.
static int CONTROL
          CTRL key.
static int DOWN
          Arrow down key.
static int ESCAPE
          Escape key.
static int LEFT
          Arrown left key.
static int RIGHT
          Arrown right key.
static int SPACE
          Space key.
static int TAB
          Tab key.
static int UP
          Arrow up key.
 
Method Summary
 int getKeyCode()
          Get the current pressed key code.
 char getKeyName()
          Get the current pressed key name.
 boolean isPressed(int key)
          Check if the key is currently pressed.
 boolean isPressedOnce(int key)
          Check if the key is currently pressed (not continuously).
 boolean used()
          Check if the keyboard is currently used (at least one pressed key).
 

Field Detail

UP

static final int UP
Arrow up key.

See Also:
Constant Field Values

DOWN

static final int DOWN
Arrow down key.

See Also:
Constant Field Values

RIGHT

static final int RIGHT
Arrown right key.

See Also:
Constant Field Values

LEFT

static final int LEFT
Arrown left key.

See Also:
Constant Field Values

CONTROL

static final int CONTROL
CTRL key.

See Also:
Constant Field Values

ALT

static final int ALT
ALT key.

See Also:
Constant Field Values

ESCAPE

static final int ESCAPE
Escape key.

See Also:
Constant Field Values

SPACE

static final int SPACE
Space key.

See Also:
Constant Field Values

TAB

static final int TAB
Tab key.

See Also:
Constant Field Values
Method Detail

isPressed

boolean isPressed(int key)
Check if the key is currently pressed.

Parameters:
key - key to check.
Returns:
key pressed ?

isPressedOnce

boolean isPressedOnce(int key)
Check if the key is currently pressed (not continuously).

Parameters:
key - key to check.
Returns:
key pressed ?

getKeyCode

int getKeyCode()
Get the current pressed key code.

Returns:
pressed key code.

getKeyName

char getKeyName()
Get the current pressed key name.

Returns:
pressed key name.

used

boolean used()
Check if the keyboard is currently used (at least one pressed key).

Returns:
true if has at least on pressed key, false else (no pressed key).