public interface Keyboard
extends com.b3dgs.lionengine.io.InputDeviceDirectional
Modifier and Type | Field and Description |
---|---|
static Integer |
ALT
ALT key.
|
static Integer |
BACK_SPACE
Back Space key.
|
static Integer |
CONTROL
CTRL key.
|
static Integer |
DOWN
Arrow down key.
|
static Integer |
ENTER
Enter key.
|
static Integer |
ESCAPE
Escape key.
|
static Integer |
LEFT
Arrow left key.
|
static Integer |
NO_KEY_CODE
No key code value.
|
static Integer |
RIGHT
Arrow right key.
|
static Integer |
TAB
Tab key.
|
static Integer |
UP
Arrow up key.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionPressed(Integer key,
EventAction action)
Add an action that will be triggered on pressed state.
|
void |
addActionReleased(Integer key,
EventAction action)
Add an action that will be triggered on released state.
|
Integer |
getKeyCode()
Get the current pressed key code.
|
char |
getKeyName()
Get the current pressed key name.
|
boolean |
isPressed(Integer key)
Check if the key is currently pressed.
|
boolean |
isPressedOnce(Integer key)
Check if the key is currently pressed (not continuously).
|
void |
removeActionsPressed()
Remove all pressed actions.
|
void |
removeActionsReleased()
Remove all released actions.
|
boolean |
used()
Check if the keyboard is currently used (at least one pressed key).
|
static final Integer UP
static final Integer DOWN
static final Integer RIGHT
static final Integer LEFT
static final Integer CONTROL
static final Integer ALT
static final Integer ESCAPE
static final Integer ENTER
static final Integer BACK_SPACE
static final Integer TAB
static final Integer NO_KEY_CODE
void addActionPressed(Integer key, EventAction action)
Alternative usage with classic programming style can be achieved with isPressed(Integer)
or
isPressedOnce(Integer)
.
key
- The action key.action
- The action reference.void addActionReleased(Integer key, EventAction action)
Alternative usage with classic programming style can be achieved with isPressed(Integer)
or
isPressedOnce(Integer)
.
key
- The action key.action
- The action reference.void removeActionsPressed()
void removeActionsReleased()
boolean isPressed(Integer key)
Alternative usage with event programming style can be achieved with
addActionPressed(Integer, EventAction)
and addActionReleased(Integer, EventAction)
.
key
- The key to check.true
if pressed, false
else.boolean isPressedOnce(Integer key)
Alternative usage with event programming style can be achieved with
addActionPressed(Integer, EventAction)
and addActionReleased(Integer, EventAction)
.
key
- The key to check.true
if pressed, false
else.Integer getKeyCode()
NO_KEY_CODE
if key never pressed).char getKeyName()
boolean used()
true
if has at least on pressed key, false
else (no pressed key).Copyright © 2017 Byron 3D Games Studio. All rights reserved.