Skip to main content

Key

class Key

Very similar to the Input system, Keys are responsible for defining screen interactions with buttons, for example, you define a Key with a certain name for a button, check if the Key was pressed, and apply the interaction.


public class Key

— Constructors (1) —

ConstructorDescription
Key(String name)Creates a new Key with its name defined to be "name" argument.

— Methods (7) —

NameDescription
boolean isPressed()Returns true if the button with the defined Key is being pressed, false if not.
void setPressed([boolean value)Defines if the button with the defined Key is being pressed or not to be "value" argument.
boolean isDown()Returns true if the button with the defined Key was pressed, false if not.
void setDown(boolean value)Defines if the button with the defined Key was pressed or not to be "value" argument.
boolean isUp()Returns true if the button with the defined Key was pressed and released, false if not.
void setUp(boolean value)Defines if the button with the defined Key was pressed and released or not to be "value" argument.
String getName()Returns the name of the Key.