Skip to main content

Input

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

Package: JAVARuntime

Category: Input

Component: no


public class Input

Static Methods

SignatureReturnsDescription
GamePad()GamePad gamePad = newExecutes GamePad and returns after the underlying engine call finishes.
Keyboard()Keyboard keyboard = newExecutes Keyboard and returns after the underlying engine call finishes.
Mouse()Mouse mouse = newExecutes Mouse and returns after the underlying engine call finishes.
haveKey(String)booleanChecks if the specified key exists.
getKey(String)KeyReturns the specified key.
registerKey(String)KeyRegisters and returns the specified key.
registerKey(Key)voidRegisters the specified key.
isKeyDown(String)booleanChecks whether the specified Key was just pressed. This returns true only on the first frame it was pressed.
isKeyPressed(String)booleanChecks whether the specified Key is currently being held down. This returns true on every frame while it remains pressed.
isKeyUp(String)booleanChecks whether the specified Key was just released. This returns true only on the first frame after it was released.
getTouch(int)TouchReturns the touch of the specified ID.
getTouchPosition(int)Vector2Returns the position of the touch of the specified ID.
getTouchPosition(int, Vector2)Vector2Returns the position of the touch of the specified ID and stores it in the provided Vector2.
isTouchDown(int)booleanChecks whether the touch of the specified ID was just pressed. This returns true only on the first frame it was pressed.
isTouchPressed(int)booleanChecks whether the touch of the specified ID is currently being held down. This returns true on every frame while it remains pressed.
isTouchUp(int)booleanChecks whether the touch of the specified ID was just released. This returns true only on the first frame after it was released.
getAxis(String)AxisReturns the Axis associated with the specified name.
registerAxis(String)AxisRegisters and returns the Axis associated with the specified name. If the Axis does not exist, it will be created.
getAxisValue(String)Vector2Returns the value of the specified Axis.
getMaxSlide()Vector2Returns the slide vector of the touch that moved the farthest.
isKeyboardOpen()booleanChecks if the virtual keyboard is currently open.
addKeyboardRequest(Component)voidRequests the opening of the virtual keyboard for the specified component.
removeKeyboardRequest(Component)voidRemoves the keyboard request from the specified component.