Skip to main content

Input

Client Server

Client Only

Input from this class can only be read on the client side.

Simple way to check a clients input. For more advanced use we recommend receive input via the events system because it respects the order in which the input was received and other benefits.

Methods

table[] GetEvents()

boolean KeyDown(keycode key)

boolean Key(keycode key)

boolean KeyUp(keycode key)

keycode[] KeyCombosDown()

boolean KeyComboDown(keycode key1, keycode? key2, keycode? key3)

boolean KeyCombo(keycode key1, keycode? key2, keycode? key3)

boolean ShiftKey()

boolean CtrlKey()

boolean AltKey()

boolean MouseButtonDown(integer button)

boolean MouseButton(integer button)

boolean MouseButtonUp(integer button)

integer MouseWheel()

Vec2 MousePos()

Vec2 MousePosLast()

Vec2 MouseMove()

Vec2 MousePosPerc()

Vec2 MousePosPercLast()

Vec2 MouseMovePerc()

boolean GetRelativeMouseMode()

nil SetRelativeMouseMode(boolean relative)

boolean GetEmulateMouseWithTouch()

nil SetEmulateMouseWithTouch(boolean emulate)

boolean GetEmulateTouchWithMouse()

nil SetEmulateTouchWithMouse(boolean emulate)

number GesturePinch()

number GestureRotate()

Vec2 GestureMove()

integer NumFingers()

boolean FingerDown(integer fingerIndex)

int passed is the unique ID of that touch obtained i.e. from Input:Fingers() or Input:GetEvents()

integer[] Fingers()

boolean FingerUp(integer fingerIndex)

Vec2 FingerPos(integer fingerIndex)

boolean VRButtonDown(integer hand, VRControllerButton button)

boolean VRButton(integer hand, VRControllerButton button)

boolean VRButtonUp(integer hand, VRControllerButton button)

number VRHandTrigger(integer hand)

number VRIndexTrigger(integer hand)

Vec2 VRThumbStick(integer hand)

Vec2 VRTrackpad(integer hand)

boolean VRIsControllerValid(integer hand)

Vec3 VRControllerPos(integer hand)

Vec3 VRControllerDir(integer hand)

Vec3 posLocal, Quat rotLocal VRControllerTransform(integer hand, Side space)

Vec3 posLocal, Quat rotLocal VRPointerTransform(integer hand, Side space)

Gamepad[] Gamepads()

Gamepad GetActiveGamepad()