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? includeEditor)​

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()​

nil InjectKey(string key, boolean down)​

Injects a synthetic key down/up into the real input funnel, as if the user pressed it.

nil InjectMouseButton(integer button, boolean down)​

nil InjectMouseMove(number dxPerc, number dyPerc)​

nil InjectMousePos(number xPerc, number yPerc)​

nil InjectMouseWheel(integer amount)​

nil ClearInjected()​

Releases all keys and buttons previously set via the Inject* functions.

nil SetAllowGameInput(boolean allow)​

boolean GetAllowGameInput()​

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()​