Input

interface Input

Functions

Link copied to clipboard
abstract fun addInputProcessor(processor: InputProcessor)

Add a InputProcessor to receive input callbacks.

Link copied to clipboard
open fun areAllKeysPressed(vararg keys: Key): Boolean

Determines if all the specified keys are currently pressed.

Link copied to clipboard
open fun areAnyKeysPressed(vararg keys: Key): Boolean

Determines if any of the specified keys are currently pressed.

Link copied to clipboard
open fun areNoKeysPressed(vararg keys: Key): Boolean

Determines if all the specified keys are NOT currently pressed.

Link copied to clipboard
open fun cancelVibrate()

Stops the vibrator.

Link copied to clipboard
abstract fun getDeltaX(pointer: Pointer): Int
Link copied to clipboard
abstract fun getDeltaY(pointer: Pointer): Int
Link copied to clipboard
abstract fun getGamepadButtonPressure(button: GameButton, gamepad: Int = 0): Float
Link copied to clipboard
abstract fun getGamepadJoystickDistance(stick: GameStick, gamepad: Int = 0): Point
Link copied to clipboard
abstract fun getGamepadJoystickXDistance(stick: GameStick, gamepad: Int = 0): Float
Link copied to clipboard
abstract fun getGamepadJoystickYDistance(stick: GameStick, gamepad: Int = 0): Float
Link copied to clipboard
abstract fun getPressure(pointer: Pointer): Float
Link copied to clipboard
abstract fun getX(pointer: Pointer): Int
Link copied to clipboard
abstract fun getY(pointer: Pointer): Int
Link copied to clipboard
abstract fun hideSoftKeyboard()

Hides the on-screen keyboard. Applicable for mobile only.

Link copied to clipboard

Creates and adds a new InputProcessor to receive input callbacks using a InputProcessBuilder.

Link copied to clipboard
abstract fun isGamepadButtonJustPressed(button: GameButton, gamepad: Int = 0): Boolean
Link copied to clipboard
abstract fun isGamepadButtonJustReleased(button: GameButton, gamepad: Int = 0): Boolean
Link copied to clipboard
abstract fun isGamepadButtonPressed(button: GameButton, gamepad: Int = 0): Boolean
Link copied to clipboard
abstract fun isJustTouched(pointer: Pointer): Boolean
Link copied to clipboard
abstract fun isKeyJustPressed(key: Key): Boolean

Determines if the key is was just pressed within the past frame.

Link copied to clipboard
abstract fun isKeyJustReleased(key: Key): Boolean

Determines if the key was just released within the past frame.

Link copied to clipboard
abstract fun isKeyPressed(key: Key): Boolean

Determines if the key is currently pressed down.

Link copied to clipboard
abstract fun isTouching(pointer: Pointer): Boolean
abstract fun isTouching(totalPointers: Int): Boolean
Link copied to clipboard
abstract fun isTouchJustReleased(pointer: Pointer): Boolean
Link copied to clipboard
abstract fun removeInputProcessor(processor: InputProcessor)

Remove a InputProcessor to from receiving input callbacks.

Link copied to clipboard
abstract fun setCursorPosition(x: Int, y: Int)
Link copied to clipboard
abstract fun showSoftKeyboard()

Shows an on-screen keyboard. Applicable for mobile only.

Link copied to clipboard
open fun vibrate(duration: Duration)

Vibrates for the given amount of time.

Properties

Link copied to clipboard
abstract val axisLeftX: Float
Link copied to clipboard
abstract val axisLeftY: Float
Link copied to clipboard
abstract val axisRightX: Float
Link copied to clipboard
abstract val axisRightY: Float
Link copied to clipboard
abstract val catchKeys: MutableList<Key>

A list of Key types to catch to prevent calling the current platforms default functionality.

Link copied to clipboard
Link copied to clipboard
abstract val currentEventTime: Long
Link copied to clipboard
abstract val deltaX: Int
Link copied to clipboard
abstract val deltaY: Int
Link copied to clipboard
abstract val gamepads: Array<GamepadInfo>
Link copied to clipboard
Link copied to clipboard
abstract val isTouching: Boolean
Link copied to clipboard
abstract val justTouched: Boolean
Link copied to clipboard
abstract val pressure: Float
Link copied to clipboard
abstract val x: Int
Link copied to clipboard
abstract val y: Int

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Extensions