Skip to main content

SUIKeyEventListener

class SUIKeyEventListener

Used to store and retrieve keys for input use, such as detecting a button press, image, etc.

See the SUIKeyEventListener component topic to learn more about SUIKeyEventListener.


public class SUIKeyEventListener extends Component

— Constructors (1) —

ConstructorDescription
SUIKeyEventListener()Creates a new SUIKeyEventListener.

— Methods (13) —

NameDescription
Key getKey()Returns the current Key of the SUIKeyEventListener.
void setKey(Key key)Sets the current Key of the SUIKeyEventListener to be "key" argument.
String getKeyName()Returns the current Key name of the SUIKeyEventListener.
void setKeyName(String name)Sets the current Key name of the SUIKeyEventListener to be "name" argument.
boolean isPressed()Returns true if the SUIKeyEventListener's Key is being pressed, false if not.
boolean isDown()Returns true if the SUIKeyEventListener's Key was pressed, false if not.
boolean isUp()Returns true if the SUIKeyEventListener's Key was pressed and released, false if not.
boolean isClickable()Returns true if the "isClickable" option of the SUIKeyEventListener is checked, false if not.
void setClickable(boolean value)Defines whether the "isClickable" option of the SUIKeyEventListener is checked or unchecked to be "value" argument.
STargetRect getTargetRectType()Returns the current type (MySelf, Parent or Other) of the SUIKeyEventListener's Target.
void setTargetRectType(STargetRect value)Defines the current type (MySelf, Parent or Other) of the Target of the SUIKeyEventListener to be "value" argument.
SpatialObject getTargetRectObject()Returns the current type of Target("MySelf", "Parent" or "Other") along with SUIKeyEventListener's SpatialObject.
void setTargetRectObject(SpatialObject object)Sets the current Target("MySelf", "Parent" or "Other") type of the SpatialObject passed to be "object" argument.