Skip to main content

Key

Complete API reference for Key, including constructors, attributes, virtual attributes, and methods.

Package: JAVARuntime

Category: Input

Component: no


public class Key

Constructors

SignatureDescription
Key(Key)Executes Key and returns after the underlying engine call finishes.
Key(String)Executes Key and returns after the underlying engine call finishes.

Attributes

NameTypeDescription
keyKeyRepresents the key value stored on this instance. Read or assign to update the property.

Virtual Attributes

NameTypeAccessDescription
downbooleangetChecks whether the Key was just pressed. This returns true only on the first frame it was pressed.
nameStringgetReturns the name of the Key.
pressedbooleangetChecks whether the Key is currently being held down. This returns true on every frame while it remains pressed.
upbooleangetChecks whether the Key was just released. This returns true only on the first frame after it was released.

Methods

SignatureReturnsDescription
requestPress(Object)voidRegisters that the key is being held down by the specified reference.
releasePress(Object)voidUnregisters the key press held by the specified reference.