JsInput

class JsInput(val canvas: HTMLCanvasElement) : Input

Author

Colton Daily

Constructors

Link copied to clipboard

Functions

Link copied to clipboard
open override 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
open override fun getDeltaX(pointer: Pointer): Int
Link copied to clipboard
open override fun getDeltaY(pointer: Pointer): Int
Link copied to clipboard
open override fun getGamepadButtonPressure(button: GameButton, gamepad: Int): Float
Link copied to clipboard
open override fun getGamepadJoystickDistance(stick: GameStick, gamepad: Int): Point
Link copied to clipboard
open override fun getGamepadJoystickXDistance(stick: GameStick, gamepad: Int): Float
Link copied to clipboard
open override fun getGamepadJoystickYDistance(stick: GameStick, gamepad: Int): Float
Link copied to clipboard
open override fun getPressure(pointer: Pointer): Float
Link copied to clipboard
open override fun getX(pointer: Pointer): Int
Link copied to clipboard
open override fun getY(pointer: Pointer): Int
Link copied to clipboard
open override 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
open override fun isGamepadButtonJustPressed(button: GameButton, gamepad: Int): Boolean
Link copied to clipboard
open override fun isGamepadButtonJustReleased(button: GameButton, gamepad: Int): Boolean
Link copied to clipboard
open override fun isGamepadButtonPressed(button: GameButton, gamepad: Int): Boolean
Link copied to clipboard
open override fun isJustTouched(pointer: Pointer): Boolean
Link copied to clipboard
open override fun isKeyJustPressed(key: Key): Boolean

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

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

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

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

Determines if the key is currently pressed down.

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

Remove a InputProcessor to from receiving input callbacks.

Link copied to clipboard
fun reset()
Link copied to clipboard
open override fun setCursorPosition(x: Int, y: Int)
Link copied to clipboard
open override fun showSoftKeyboard()

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

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

Vibrates for the given amount of time.

Properties

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

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

Link copied to clipboard
open override val connectedGamepads: List<GamepadInfo>
Link copied to clipboard
open override val currentEventTime: Long
Link copied to clipboard
open override val deltaX: Int
Link copied to clipboard
open override val deltaY: Int
Link copied to clipboard
open override val gamepads: Array<GamepadInfo>
Link copied to clipboard
open override val inputProcessors: List<InputProcessor>
Link copied to clipboard
open override val isTouching: Boolean
Link copied to clipboard
open override val justTouched: Boolean
Link copied to clipboard
open override val pressure: Float
Link copied to clipboard
open override val x: Int
Link copied to clipboard
open override val y: Int

Extensions