UserInputService
UserInputService
is primarily used to detect the input types available on a
user's device, as well as detect input events.
Memory category | Instances |
---|
Member index 81
Removed member index 10
History | Member | |
---|---|---|
220 | InCameraGesture: bool | |
240 | IsVREnabled: bool | |
220 | OverrideMouseIconEnabled: bool | |
118 | TouchControlsEnabled: bool | |
230 | IsLuaTouchControls(): bool | |
230 | IsStudioTouchEmulationEnabled(): bool | |
230 | RotateCamera(positionDelta: Vector2): void | |
230 | ZoomCamera(zoomDelta: float): void | |
230 | ProcessedEvent(inputObject: Instance, processed: bool) |
Description
UserInputService
is primarily used to detect the input types available on a
user's device, as well as detect input events. It allows you to perform
different actions depending on the device and, in turn, provide the best
experience for the end user.
As this service is intended for client-side usage only, its properties, methods, and events can only be used in a LocalScript, a ModuleScript required by a LocalScript, or a Script with RunContext set to RunContext.Client.
History 326
- 675 Add PreferredInput
- 672 Add GetPasteText
- 650 Change Security of TouchDrag from RobloxScriptSecurity to None
- 645 Change ReturnType of GetImageForKeyCode from Content to ContentId
- 645 Change ValueType of MouseIcon from Content to ContentId
- 642 Add TouchDrag
- 638 Add GetDeviceLevel
- 637 Change Tags of from [Hidden] to [Hidden, Deprecated]
- 605 Change Tags of UserCFrameChanged from [] to [Deprecated]
- 605 Change PreferredDescriptor of UserCFrameChanged from to UserCFrameChanged
- 605 Change Tags of GetUserCFrame from [] to [Deprecated]
- 605 Change PreferredDescriptor of GetUserCFrame from to GetUserCFrame
- 594 Add GetImageForKeyCode
- 573 Change ReturnType of SetNavigationGamepad from void to null
- 573 Change ReturnType of SendAppUISizes from void to null
- 573 Change ReturnType of RecenterUserHeadCFrame from void to null
- 572 Remove
- 563 Add MouseIcon
- 553 Change Default of VREnabled from to
- 553 Change Default of UserHeadCFrame from to
- 553 Change Default of TouchEnabled from to
- 553 Change Default of from to
- 553 Change Default of from to
- 553 Change Default of from to
- 553 Change Default of OnScreenKeyboardVisible from to
- 553 Change Default of OnScreenKeyboardSize from to
- 553 Change Default of OnScreenKeyboardPosition from to
- 553 Change Default of from to
- 553 Change Default of from to
- 553 Change Default of MouseIconEnabled from to
- 553 Change Default of MouseEnabled from to
- 553 Change Default of MouseDeltaSensitivity from to
- 553 Change Default of MouseBehavior from to
- 553 Change PreferredDescriptor of ModalEnabled from to TouchControlsEnabled
- 553 Change Default of ModalEnabled from to
- 553 Change Default of from to
- 553 Change Default of KeyboardEnabled from to
- 553 Change Default of GyroscopeEnabled from to
- 553 Change Default of from to
- 553 Change Default of GamepadEnabled from to
- 553 Change Default of from to
- 553 Change Default of AccelerometerEnabled from to
- 493 Change Tags of ModalEnabled from [] to [Deprecated]
- 486 Change ThreadSafety of VREnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of UserHeadCFrame from ReadOnly to ReadSafe
- 486 Change ThreadSafety of TouchEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of OnScreenKeyboardVisible from ReadOnly to ReadSafe
- 486 Change ThreadSafety of OnScreenKeyboardSize from ReadOnly to ReadSafe
- 486 Change ThreadSafety of OnScreenKeyboardPosition from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MouseIconEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MouseEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MouseDeltaSensitivity from ReadOnly to ReadSafe
- 486 Change ThreadSafety of MouseBehavior from ReadOnly to ReadSafe
- 486 Change ThreadSafety of ModalEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of KeyboardEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of GyroscopeEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of GamepadEnabled from ReadOnly to ReadSafe
- 486 Change ThreadSafety of from ReadOnly to ReadSafe
- 486 Change ThreadSafety of AccelerometerEnabled from ReadOnly to ReadSafe
- 483 Change Parameters of TouchStarted from (touch: Instance, gameProcessedEvent: bool) to (touch: InputObject, gameProcessedEvent: bool)
- 483 Change Parameters of TouchMoved from (touch: Instance, gameProcessedEvent: bool) to (touch: InputObject, gameProcessedEvent: bool)
- 483 Change Parameters of TouchEnded from (touch: Instance, gameProcessedEvent: bool) to (touch: InputObject, gameProcessedEvent: bool)
- 483 Change Parameters of TextBoxFocused from (textboxFocused: Instance) to (textboxFocused: TextBox)
- 483 Change Parameters of TextBoxFocusReleased from (textboxReleased: Instance) to (textboxReleased: TextBox)
- 483 Change Parameters of InputEnded from (input: Instance, gameProcessedEvent: bool) to (input: InputObject, gameProcessedEvent: bool)
- 483 Change Parameters of InputChanged from (input: Instance, gameProcessedEvent: bool) to (input: InputObject, gameProcessedEvent: bool)
- 483 Change Parameters of InputBegan from (input: Instance, gameProcessedEvent: bool) to (input: InputObject, gameProcessedEvent: bool)
- 483 Change Parameters of DeviceRotationChanged from (rotation: Instance, cframe: CFrame) to (rotation: InputObject, cframe: CFrame)
- 483 Change Parameters of DeviceGravityChanged from (gravity: Instance) to (gravity: InputObject)
- 483 Change Parameters of DeviceAccelerationChanged from (acceleration: Instance) to (acceleration: InputObject)
- 483 Change ReturnType of GetFocusedTextBox from Instance to TextBox
- 483 Change ReturnType of GetDeviceGravity from Instance to InputObject
- 483 Change ReturnType of GetDeviceAcceleration from Instance to InputObject
- 469 Change Tags of from [ReadOnly, NotReplicated] to [Hidden, ReadOnly, NotReplicated]
- 469 Change Tags of from [ReadOnly, NotReplicated] to [Hidden, ReadOnly, NotReplicated]
- 469 Change Tags of from [] to [Hidden]
- 469 Change Tags of from [ReadOnly, NotReplicated] to [Hidden, ReadOnly, NotReplicated]
- 469 Change Tags of from [ReadOnly, NotReplicated] to [Hidden, ReadOnly, NotReplicated]
- 469 Change Tags of from [] to [Hidden]
- 469 Change Tags of from [ReadOnly, NotReplicated] to [Hidden, ReadOnly, NotReplicated]
- 462 Change ThreadSafety of WindowFocused from to Unsafe
- 462 Change ThreadSafety of WindowFocusReleased from to Unsafe
- 462 Change ThreadSafety of UserCFrameChanged from to Unsafe
- 462 Change ThreadSafety of TouchTapInWorld from to Unsafe
- 462 Change ThreadSafety of TouchTap from to Unsafe
- 462 Change ThreadSafety of TouchSwipe from to Unsafe
- 462 Change ThreadSafety of TouchStarted from to Unsafe
- 462 Change ThreadSafety of TouchRotate from to Unsafe
- 462 Change ThreadSafety of TouchPinch from to Unsafe
- 462 Change ThreadSafety of TouchPan from to Unsafe
- 462 Change ThreadSafety of TouchMoved from to Unsafe
- 462 Change ThreadSafety of TouchLongPress from to Unsafe
- 462 Change ThreadSafety of TouchEnded from to Unsafe
- 462 Change ThreadSafety of TextBoxFocused from to Unsafe
- 462 Change ThreadSafety of TextBoxFocusReleased from to Unsafe
- 462 Change ThreadSafety of StatusBarTapped from to Unsafe
- 462 Change ThreadSafety of PointerAction from to Unsafe
- 462 Change ThreadSafety of LastInputTypeChanged from to Unsafe
- 462 Change ThreadSafety of JumpRequest from to Unsafe
- 462 Change ThreadSafety of InputEnded from to Unsafe
- 462 Change ThreadSafety of InputChanged from to Unsafe
- 462 Change ThreadSafety of InputBegan from to Unsafe
- 462 Change ThreadSafety of GamepadDisconnected from to Unsafe
- 462 Change ThreadSafety of GamepadConnected from to Unsafe
- 462 Change ThreadSafety of DeviceRotationChanged from to Unsafe
- 462 Change ThreadSafety of DeviceGravityChanged from to Unsafe
- 462 Change ThreadSafety of DeviceAccelerationChanged from to Unsafe
- 462 Change ThreadSafety of SetNavigationGamepad from to Unsafe
- 462 Change ThreadSafety of SendAppUISizes from to Unsafe
- 462 Change ThreadSafety of RecenterUserHeadCFrame from to Unsafe
- 462 Change ThreadSafety of IsNavigationGamepad from to Unsafe
- 462 Change ThreadSafety of IsMouseButtonPressed from to Unsafe
- 462 Change ThreadSafety of IsKeyDown from to Unsafe
- 462 Change ThreadSafety of IsGamepadButtonDown from to Unsafe
- 462 Change ThreadSafety of GetUserCFrame from to Unsafe
- 462 Change ThreadSafety of GetSupportedGamepadKeyCodes from to Unsafe
- 462 Change ThreadSafety of GetStringForKeyCode from to Unsafe
- 462 Change ThreadSafety of GetPlatform from to Unsafe
- 462 Change ThreadSafety of GetNavigationGamepads from to Unsafe
- 462 Change ThreadSafety of GetMouseLocation from to Unsafe
- 462 Change ThreadSafety of GetMouseDelta from to Unsafe
- 462 Change ThreadSafety of GetMouseButtonsPressed from to Unsafe
- 462 Change ThreadSafety of GetLastInputType from to Unsafe
- 462 Change ThreadSafety of GetKeysPressed from to Unsafe
- 462 Change ThreadSafety of GetGamepadState from to Unsafe
- 462 Change ThreadSafety of GetGamepadConnected from to Unsafe
- 462 Change ThreadSafety of GetFocusedTextBox from to Unsafe
- 462 Change ThreadSafety of GetDeviceType from to Unsafe
- 462 Change ThreadSafety of GetDeviceRotation from to Unsafe
- 462 Change ThreadSafety of GetDeviceGravity from to Unsafe
- 462 Change ThreadSafety of GetDeviceAcceleration from to Unsafe
- 462 Change ThreadSafety of GetConnectedGamepads from to Unsafe
- 462 Change ThreadSafety of GamepadSupports from to Unsafe
- 462 Change ThreadSafety of VREnabled from to ReadOnly
- 462 Change ThreadSafety of UserHeadCFrame from to ReadOnly
- 462 Change ThreadSafety of TouchEnabled from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of OnScreenKeyboardVisible from to ReadOnly
- 462 Change ThreadSafety of OnScreenKeyboardSize from to ReadOnly
- 462 Change ThreadSafety of OnScreenKeyboardPosition from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of MouseIconEnabled from to ReadOnly
- 462 Change ThreadSafety of MouseEnabled from to ReadOnly
- 462 Change ThreadSafety of MouseDeltaSensitivity from to ReadOnly
- 462 Change ThreadSafety of MouseBehavior from to ReadOnly
- 462 Change ThreadSafety of ModalEnabled from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of KeyboardEnabled from to ReadOnly
- 462 Change ThreadSafety of GyroscopeEnabled from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of GamepadEnabled from to ReadOnly
- 462 Change ThreadSafety of from to ReadOnly
- 462 Change ThreadSafety of AccelerometerEnabled from to ReadOnly
- 398 Add PointerAction
- 379 Add GetStringForKeyCode
- 377 Add GetDeviceType
- 360 Change Parameters of SendAppUISizes from (statusBarSize: Vector2, navBarSize: Vector2, bottomBarSize: Vector2) to (statusBarSize: Vector2, navBarSize: Vector2, bottomBarSize: Vector2, rightBarSize: Vector2)
- 360 Add
- 334 Add
- 330 Add IsGamepadButtonDown
- 322 Add StatusBarTapped
- 315 Add SendAppUISizes
- 314 Add
- 314 Add
- 314 Add
- 308 Add
- 297 Add TouchTapInWorld
- 297 Add IsMouseButtonPressed
- 297 Add GetMouseLocation
- 297 Add GetMouseDelta
- 297 Add GetMouseButtonsPressed
- 281 Add OnScreenKeyboardVisible
- 281 Add OnScreenKeyboardSize
- 281 Add OnScreenKeyboardPosition
- 262 Add
- 246 Add MouseDeltaSensitivity
- 240 Remove IsVREnabled
- 236 Add UserCFrameChanged
- 236 Add GetUserCFrame
- 236 Change Tags of UserHeadCFrame from [ReadOnly, NotReplicated] to [ReadOnly, NotReplicated, Deprecated]
- 234 Add RecenterUserHeadCFrame
- 230 Remove ProcessedEvent
- 230 Remove ZoomCamera
- 230 Remove RotateCamera
- 230 Remove IsStudioTouchEmulationEnabled
- 230 Remove IsLuaTouchControls
- 230 Add VREnabled
- 230 Change Tags of IsVREnabled from [ReadOnly] to [ReadOnly, Deprecated]
- 229 Add UserHeadCFrame
- 229 Add IsVREnabled
- 226 Change Security of LastInputTypeChanged from RobloxScriptSecurity to None
- 226 Change Security of GetLastInputType from RobloxScriptSecurity to None
- 220 Remove OverrideMouseIconEnabled
- 220 Remove InCameraGesture
- 217 Add GetNavigationGamepads
- 217 Add GetConnectedGamepads
- 213 Add GetFocusedTextBox
- 208 Add LastInputTypeChanged
- 208 Add GetLastInputType
- 208 Add
- 207 Add SetNavigationGamepad
- 207 Add IsNavigationGamepad
- 189 Add WindowFocused
- 189 Add WindowFocusReleased
- 189 Add IsKeyDown
- 189 Add GetKeysPressed
- 188 Remove WindowFocused
- 188 Remove WindowFocusReleased
- 188 Remove IsKeyDown
- 188 Remove GetKeysPressed
- 189 Add WindowFocused
- 189 Add WindowFocusReleased
- 189 Add IsKeyDown
- 189 Add GetKeysPressed
- 185 Add GamepadDisconnected
- 185 Add GamepadConnected
- 185 Add GetSupportedGamepadKeyCodes
- 185 Add GetGamepadState
- 185 Add GetGamepadConnected
- 185 Add GamepadSupports
- 171 Add IsStudioTouchEmulationEnabled
- 168 Add DeviceRotationChanged
- 168 Add DeviceGravityChanged
- 168 Add DeviceAccelerationChanged
- 168 Add GetDeviceRotation
- 168 Add GetDeviceGravity
- 168 Add GetDeviceAcceleration
- 168 Add OverrideMouseIconEnabled
- 168 Add GyroscopeEnabled
- 168 Add AccelerometerEnabled
- 161 Change Parameters of TouchTap from (touchPositions: Array) to (touchPositions: Array, gameProcessedEvent: bool)
- 161 Change Parameters of TouchSwipe from (swipeDirection: SwipeDirection, numberOfTouches: int) to (swipeDirection: SwipeDirection, numberOfTouches: int, gameProcessedEvent: bool)
- 161 Change Parameters of TouchStarted from (touch: Instance) to (touch: Instance, gameProcessedEvent: bool)
- 161 Change Parameters of TouchRotate from (touchPositions: Array, rotation: float, velocity: float, state: UserInputState) to (touchPositions: Array, rotation: float, velocity: float, state: UserInputState, gameProcessedEvent: bool)
- 161 Change Parameters of TouchPinch from (touchPositions: Array, scale: float, velocity: float, state: UserInputState) to (touchPositions: Array, scale: float, velocity: float, state: UserInputState, gameProcessedEvent: bool)
- 161 Change Parameters of TouchPan from (touchPositions: Array, totalTranslation: Vector2, velocity: Vector2, state: UserInputState) to (touchPositions: Array, totalTranslation: Vector2, velocity: Vector2, state: UserInputState, gameProcessedEvent: bool)
- 161 Change Parameters of TouchMoved from (touch: Instance) to (touch: Instance, gameProcessedEvent: bool)
- 161 Change Parameters of TouchLongPress from (touchPositions: Array, state: UserInputState) to (touchPositions: Array, state: UserInputState, gameProcessedEvent: bool)
- 161 Change Parameters of TouchEnded from (touch: Instance) to (touch: Instance, gameProcessedEvent: bool)
- 161 Add TextBoxFocused
- 161 Add TextBoxFocusReleased
- 161 Change Parameters of InputEnded from (input: Instance) to (input: Instance, gameProcessedEvent: bool)
- 161 Change Parameters of InputChanged from (input: Instance) to (input: Instance, gameProcessedEvent: bool)
- 161 Change Parameters of InputBegan from (input: Instance) to (input: Instance, gameProcessedEvent: bool)
- 158 Add MouseIconEnabled
- 158 Add MouseBehavior
- 156 Add GetPlatform
- 150 Add InCameraGesture
- 143 Add ProcessedEvent
- 138 Change Security of TouchTap from RobloxScriptSecurity to None
- 138 Change Security of TouchSwipe from RobloxScriptSecurity to None
- 138 Change Security of TouchStarted from RobloxScriptSecurity to None
- 138 Change Security of TouchRotate from RobloxScriptSecurity to None
- 138 Change Security of TouchPinch from RobloxScriptSecurity to None
- 138 Change Security of TouchPan from RobloxScriptSecurity to None
- 138 Change Security of TouchMoved from RobloxScriptSecurity to None
- 138 Change Security of TouchLongPress from RobloxScriptSecurity to None
- 138 Change Security of TouchEnded from RobloxScriptSecurity to None
- 138 Change Security of InputEnded from RobloxScriptSecurity to None
- 138 Change Security of InputChanged from RobloxScriptSecurity to None
- 138 Change Security of InputBegan from RobloxScriptSecurity to None
- 133 Change Parameters of TouchStarted from (touch: InputObject) to (touch: Instance)
- 133 Change Parameters of TouchMoved from (touch: InputObject) to (touch: Instance)
- 133 Change Parameters of TouchEnded from (touch: InputObject) to (touch: Instance)
- 133 Change Parameters of InputEnded from (input: InputObject) to (input: Instance)
- 133 Change Parameters of InputChanged from (input: InputObject) to (input: Instance)
- 133 Change Parameters of InputBegan from (input: InputObject) to (input: Instance)
- 131 Change Parameters of TouchTap from (position: Vector2) to (touchPositions: Array)
- 131 Change Parameters of TouchRotate from (rotation: float, velocity: float, state: UserInputState, position: Vector2) to (touchPositions: Array, rotation: float, velocity: float, state: UserInputState)
- 131 Change Parameters of TouchPinch from (scale: float, velocity: float, state: UserInputState, position: Vector2) to (touchPositions: Array, scale: float, velocity: float, state: UserInputState)
- 131 Change Parameters of TouchPan from (totalTranslation: Vector2, velocity: Vector2, numberOfTouches: int, state: UserInputState, position: Vector2) to (touchPositions: Array, totalTranslation: Vector2, velocity: Vector2, state: UserInputState)
- 131 Change Parameters of TouchLongPress from (position: UserInputState, state: Vector2) to (touchPositions: Array, state: UserInputState)
- 131 Add ZoomCamera
- 131 Add RotateCamera
- 131 Add IsLuaTouchControls
- 130 Change Parameters of TouchRotate from (rotation: float, velocity: float) to (rotation: float, velocity: float, state: UserInputState, position: Vector2)
- 130 Change Parameters of TouchPinch from (scale: float, velocity: float) to (scale: float, velocity: float, state: UserInputState, position: Vector2)
- 130 Add TouchPan
- 130 Change Parameters of TouchLongPress from (position: Vector2, state: UserInputState) to (position: UserInputState, state: Vector2)
- 128 Change Security of TouchTap from RobloxSecurity to RobloxScriptSecurity
- 128 Change Security of TouchSwipe from RobloxSecurity to RobloxScriptSecurity
- 128 Change Parameters of TouchSwipe from (swipeDirection: SwipeDirection) to (swipeDirection: SwipeDirection, numberOfTouches: int)
- 128 Change Security of TouchStarted from RobloxSecurity to RobloxScriptSecurity
- 128 Change Security of TouchRotate from RobloxSecurity to RobloxScriptSecurity
- 128 Change Security of TouchPinch from RobloxSecurity to RobloxScriptSecurity
- 128 Change Security of TouchMoved from RobloxSecurity to RobloxScriptSecurity
- 128 Change Security of TouchLongPress from RobloxSecurity to RobloxScriptSecurity
- 128 Change Parameters of TouchLongPress from (position: Vector2) to (position: Vector2, state: UserInputState)
- 128 Change Security of TouchEnded from RobloxSecurity to RobloxScriptSecurity
- 128 Add InputEnded
- 128 Add InputChanged
- 128 Add InputBegan
- 118 Change Security of JumpRequest from RobloxPlaceSecurity to None
- 118 Remove TouchControlsEnabled
- 118 Add ModalEnabled
- 115 Add TouchControlsEnabled
- 113 Add TouchTap
- 113 Add TouchSwipe
- 113 Add TouchStarted
- 113 Add TouchRotate
- 113 Add TouchPinch
- 113 Add TouchMoved
- 113 Add TouchLongPress
- 113 Add TouchEnded
- 113 Add JumpRequest
- 80 Add TouchEnabled
- 80 Add MouseEnabled
- 80 Add KeyboardEnabled
- 80 Add GamepadEnabled
- 80 Add UserInputService
- 79 Remove UserInputService
- 80 Add TouchEnabled
- 80 Add MouseEnabled
- 80 Add KeyboardEnabled
- 80 Add GamepadEnabled
- 80 Add UserInputService
Members 81
AccelerometerEnabled
Type | Default | |
---|---|---|
bool |
This property describes whether the user's device has an accelerometer, a component found in most mobile devices that measures acceleration (change in speed).
If the device has an enabled accelerometer, you can get its current acceleration by using the GetDeviceAcceleration() method or track when the device's acceleration changes through the DeviceAccelerationChanged event.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
History 4
- 553 Change Default of AccelerometerEnabled from to
- 486 Change ThreadSafety of AccelerometerEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of AccelerometerEnabled from to ReadOnly
- 168 Add AccelerometerEnabled
DeviceAccelerationChanged
Parameters (1) | |
---|---|
acceleration | InputObject |
This event fires when a user moves a device that has an accelerometer, a component found in most mobile devices that measures acceleration (change in speed). To determine whether a user's device has an accelerometer enabled, use AccelerometerEnabled.
This event can be used along with GetDeviceAcceleration() to determine the current movement of a user's device.
Thread safety | Unsafe |
---|
History 3
- 483 Change Parameters of DeviceAccelerationChanged from (acceleration: Instance) to (acceleration: InputObject)
- 462 Change ThreadSafety of DeviceAccelerationChanged from to Unsafe
- 168 Add DeviceAccelerationChanged
DeviceGravityChanged
Parameters (1) | |
---|---|
gravity | InputObject |
This event fires when the device's gravity Vector3 changes on a device that has an accelerometer. To determine whether a user's device has an accelerometer enabled, use AccelerometerEnabled.
A device's gravity vector represent the force of gravity on each of the
device's X, Y, and Z axes. While gravity never changes, the
force it exerts on each axis changes when the device rotates and changes
orientation. The force value exerted on each axis is a unit vector ranging
from -1
to 1
.
If the device has an enabled accelerometer, you can use the GetDeviceGravity() method to get the current force of gravity on the user's device.
Thread safety | Unsafe |
---|
History 3
- 483 Change Parameters of DeviceGravityChanged from (gravity: Instance) to (gravity: InputObject)
- 462 Change ThreadSafety of DeviceGravityChanged from to Unsafe
- 168 Add DeviceGravityChanged
DeviceRotationChanged
Parameters (2) | |
---|---|
rotation | InputObject |
cframe | CFrame |
This event fires when a user rotates a device that has a gyroscope, a component found in most mobile devices that detects orientation and rotational speed. To check if a user's device has an enabled gyroscope, use GyroscopeEnabled.
To query the current device rotation, use the GetDeviceRotation() method.
Note that this event only fires when the Roblox client window is in focus. Inputs will not be captured when the window is minimized.
Thread safety | Unsafe |
---|
History 3
- 483 Change Parameters of DeviceRotationChanged from (rotation: Instance, cframe: CFrame) to (rotation: InputObject, cframe: CFrame)
- 462 Change ThreadSafety of DeviceRotationChanged from to Unsafe
- 168 Add DeviceRotationChanged
GamepadConnected
Parameters (1) | |
---|---|
gamepadNum | UserInputType |
This event fires when a gamepad is connected to the client. You can also use GetConnectedGamepads() to find the correct gamepad to use.
Alternatively, you can detect value changes to the PreferredInput property which more accurately reflects which input (mouse/keyboard, touch, gamepad, etc.) the player is likely using as the primary input.
See also GamepadDisconnected.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GamepadConnected from to Unsafe
- 185 Add GamepadConnected
GamepadDisconnected
Parameters (1) | |
---|---|
gamepadNum | UserInputType |
This event fires when a gamepad is disconnected from the client.
Alternatively, you can detect value changes to the PreferredInput property which more accurately reflects which input (mouse/keyboard, touch, gamepad, etc.) the player is likely using as the primary input.
See also GamepadConnected.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GamepadDisconnected from to Unsafe
- 185 Add GamepadDisconnected
GamepadEnabled
Type | Default | |
---|---|---|
bool |
This property describes whether the user's device has an available
gamepad. If true
, you can use gamepad‑related methods such as
GetConnectedGamepads().
For seamless cross-platform compatibility on mixed-input devices, see PreferredInput which more accurately reflects which input (mouse/keyboard, touch, gamepad, etc.) the player is likely using as the primary input.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
History 6
- 553 Change Default of GamepadEnabled from to
- 486 Change ThreadSafety of GamepadEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of GamepadEnabled from to ReadOnly
- 80 Add GamepadEnabled
- 79 Remove UserInputService
- 80 Add GamepadEnabled
GamepadSupports
Parameters (2) | ||
---|---|---|
gamepadNum | UserInputType | |
gamepadKeyCode | KeyCode | |
Returns (1) | ||
bool |
This method returns whether the given UserInputType gamepad supports a button corresponding with the given KeyCode.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GamepadSupports from to Unsafe
- 185 Add GamepadSupports
GetConnectedGamepads
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
This method returns an array of UserInputType gamepads currently connected. If no gamepads are connected, the array will be empty.
Alternatively to detecting all gamepads, the PreferredInput property can be used to more accurately reflect which input (mouse/keyboard, touch, gamepad, etc.) the player is likely using as the primary input.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetConnectedGamepads from to Unsafe
- 217 Add GetConnectedGamepads
GetDeviceAcceleration
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
InputObject |
This method returns an InputObject that describes the device's current acceleration. For this to function, the user's device must have an enabled accelerometer as queried through the AccelerometerEnabled property.
To track when the device's acceleration changes, use the DeviceAccelerationChanged event.
Thread safety | Unsafe |
---|
History 3
- 483 Change ReturnType of GetDeviceAcceleration from Instance to InputObject
- 462 Change ThreadSafety of GetDeviceAcceleration from to Unsafe
- 168 Add GetDeviceAcceleration
GetDeviceGravity
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
InputObject |
This method returns an InputObject describing the device's current gravity vector. The vector is determined by the device's orientation relative to the real-world force of gravity. For example:
- Vector3.new(0, 0, -9.18) if the device is perfectly upright (portrait)
- Vector3.new(9.81, 0, 0) if the left side of the device is pointing down
- Vector3.new(0, -9.81, 0) if the back of the device is pointing down
Gravity is only tracked for devices with an enabled gyroscope as queried through GyroscopeEnabled.
To track when the device's gravity changes, use the DeviceGravityChanged event.
Thread safety | Unsafe |
---|
History 3
- 483 Change ReturnType of GetDeviceGravity from Instance to InputObject
- 462 Change ThreadSafety of GetDeviceGravity from to Unsafe
- 168 Add GetDeviceGravity
GetDeviceLevel
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
DeviceLevel |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 638 Add GetDeviceLevel
GetDeviceRotation
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Tuple |
This method returns an InputObject and a CFrame describing the device's current rotation vector.
Device rotation is only tracked for devices with an enabled gyroscope as queried through GyroscopeEnabled.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetDeviceRotation from to Unsafe
- 168 Add GetDeviceRotation
GetDeviceType
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
DeviceType |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of GetDeviceType from to Unsafe
- 377 Add GetDeviceType
GetFocusedTextBox
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
TextBox |
This method returns the TextBox the client is currently focused
on. A TextBox can be manually selected by the user, or selection
can be forced using the TextBox:CaptureFocus() method. If no
TextBox is selected, this method will return nil
.
Thread safety | Unsafe |
---|
History 3
- 483 Change ReturnType of GetFocusedTextBox from Instance to TextBox
- 462 Change ThreadSafety of GetFocusedTextBox from to Unsafe
- 213 Add GetFocusedTextBox
GetGamepadConnected
Parameters (1) | ||
---|---|---|
gamepadNum | UserInputType | |
Returns (1) | ||
bool |
This method returns whether a gamepad with the given UserInputType is connected.
Alternatively to detecting a specific gamepad by UserInputType, the PreferredInput property can be used to more accurately reflect which input (mouse/keyboard, touch, gamepad, etc.) the player is likely using as the primary input.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetGamepadConnected from to Unsafe
- 185 Add GetGamepadConnected
GetGamepadState
Parameters (1) | ||
---|---|---|
gamepadNum | UserInputType | |
Returns (1) | ||
Array |
This method returns an array of InputObjects for all available inputs on the given UserInputType gamepad, representing each input's last input state.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetGamepadState from to Unsafe
- 185 Add GetGamepadState
GetImageForKeyCode
Parameters (1) | ||
---|---|---|
keyCode | KeyCode | |
Returns (1) | ||
ContentId |
This method takes the requested KeyCode and returns the associated image for the currently connected gamepad device (limited to Xbox, PlayStation, and Windows). This means that if the connected controller is an Xbox One controller, the user sees Xbox assets. Similarly, if the connected device is a PlayStation controller, the user sees PlayStation assets. If you want to use custom assets, see GetStringForKeyCode().
Thread safety | Unsafe |
---|
History 2
- 645 Change ReturnType of GetImageForKeyCode from Content to ContentId
- 594 Add GetImageForKeyCode
GetKeysPressed
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
This method returns an array of InputObjects associated with the keys currently being pressed down. The array can be iterated through to determine which keys are currently being pressed, using the InputObject.KeyCode names or values.
To check if a specific key is being pressed, use IsKeyDown().
Thread safety | Unsafe |
---|
History 4
- 462 Change ThreadSafety of GetKeysPressed from to Unsafe
- 189 Add GetKeysPressed
- 188 Remove GetKeysPressed
- 189 Add GetKeysPressed
GetLastInputType
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
UserInputType |
This method returns the UserInputType associated with the user's most recent input. For example, if the user's previous input had been pressing the A key, the returned UserInputType value would be Keyboard.
For seamless cross-platform compatibility on mixed-input devices, see
PreferredInput which more
accurately reflects which input (mouse/keyboard, touch, gamepad, etc.) the
player is likely using as the primary input. GetLastInputType()
remains for advanced workflows or control schemes that rely on detecting
and responding to the player's specific most recent UserInputType.
Thread safety | Unsafe |
---|
History 3
- 462 Change ThreadSafety of GetLastInputType from to Unsafe
- 226 Change Security of GetLastInputType from RobloxScriptSecurity to None
- 208 Add GetLastInputType
GetMouseButtonsPressed
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
This method returns an array of InputObjects associated with the mouse buttons currently being held down. The array can be iterated through to determine which buttons are currently being held, using the InputObject.KeyCode names or values.
Mouse buttons that are tracked by this method include MouseButton1
(left), MouseButton2
(right), and MouseButton3
(middle).
If the user is not pressing any mouse button down when the method is called, it will return an empty array.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetMouseButtonsPressed from to Unsafe
- 297 Add GetMouseButtonsPressed
GetMouseDelta
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Vector2 |
This method returns the change, in pixels, of the position of the player's
Mouse in the last rendered frame, only if the mouse has been
locked using the MouseBehavior
property; otherwise the returned Vector2 values will be 0
.
The sensitivity of the mouse, determined in the client's settings and MouseDeltaSensitivity, will influence the result.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetMouseDelta from to Unsafe
- 297 Add GetMouseDelta
GetMouseLocation
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Vector2 |
This method returns a Vector2 representing the current screen location of the player's Mouse in pixels relative to the top‑left corner. This does not account for the ScreenInsets; to get the top‑left and bottom‑right insets, call GuiService:GetGuiInset().
If the location of the mouse pointer is offscreen or the player's device does not have a mouse, the returned value will be undetermined.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetMouseLocation from to Unsafe
- 297 Add GetMouseLocation
GetPasteText
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
string |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 1
- 672 Add GetPasteText
GetPlatform
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Platform |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of GetPlatform from to Unsafe
- 156 Add GetPlatform
GetStringForKeyCode
Parameters (1) | ||
---|---|---|
keyCode | KeyCode | |
Returns (1) | ||
string |
This method returns a string representing a key the user should press in order to input a given KeyCode, keeping in mind their keyboard layout. For key codes that require some modifier to be held, this method returns the key to be pressed in addition to the modifier. See the examples below for further explanation.
When using Roblox with a non‑QWERTY keyboard layout, key codes are mapped to equivalent QWERTY positions. For example, pressing A on an AZERTY keyboard results in KeyCode.Q, potentially leading to mismatched information on experience UI elements. This method solves the issue by providing the actual key to be pressed while using non‑QWERTY keyboard layouts.
KeyCode | QWERTY Return | AZERTY Return |
---|---|---|
KeyCode.Q | Q | A |
KeyCode.W | W | Z |
KeyCode.Equals | = | = |
KeyCode.At | 2 because @ is typed with Shift2 | É |
Gamepad Usage
GetStringForKeyCode()
returns the string mapping for the KeyCode
for the most recently connected gamepad. If the connected controller is
not supported, the method returns the default string conversion for the
requested key code.
The following example shows how you can map custom assets for ButtonA:
local UserInputService = game:GetService("UserInputService")
local imageLabel = script.Parent
local key = Enum.KeyCode.ButtonA
local mappings = {
ButtonA = "rbxasset://BUTTON_A_ASSET", -- Replace with the desired ButtonA asset
ButtonCross = "rbxasset://BUTTON_CROSS_ASSET" -- Replace with the desired ButtonCross asset
}
local mappedKey = UserInputService:GetStringForKeyCode(key)
local image = mappings[mappedKey]
imageLabel.Image = image
Gamepad Mappings
The directional pad key codes do not have any differences based on device. KeyCode.ButtonSelect has slightly different behavior in some cases. Use both PlayStation mappings to ensure users see the correct buttons.
KeyCode | PlayStation Return Value | Xbox Return Value |
---|---|---|
KeyCode.ButtonA | ButtonCross | ButtonA |
KeyCode.ButtonB | ButtonCircle | ButtonB |
KeyCode.ButtonX | ButtonSquare | ButtonX |
KeyCode.ButtonY | ButtonTriangle | ButtonY |
KeyCode.ButtonL1 | ButtonL1 | ButtonLB |
KeyCode.ButtonL2 | ButtonL2 | ButtonLT |
KeyCode.ButtonL3 | ButtonL3 | ButtonLS |
KeyCode.ButtonR1 | ButtonR1 | ButtonRB |
KeyCode.ButtonR2 | ButtonR2 | ButtonRT |
KeyCode.ButtonR3 | ButtonR3 | ButtonRS |
KeyCode.ButtonStart | ButtonOptions | ButtonStart |
KeyCode.ButtonSelect | ButtonTouchpad and ButtonShare | ButtonSelect |
Legacy System Images
When using a KeyCode that may be better represented as an image, such as for an ImageLabel in a user interface, you can use the following legacy icons. However, it's recommended that you use GetImageForKeyCode() as a more modern, cross‑platform method to retrieve Xbox and PlayStation controller icons.
KeyCode | Asset ID |
---|---|
KeyCode.ButtonX | rbxasset://textures/ui/Controls/xboxX.png |
KeyCode.ButtonY | rbxasset://textures/ui/Controls/xboxY.png |
KeyCode.ButtonA | rbxasset://textures/ui/Controls/xboxA.png |
KeyCode.ButtonB | rbxasset://textures/ui/Controls/xboxB.png |
KeyCode.DPadLeft | rbxasset://textures/ui/Controls/dpadLeft.png |
KeyCode.DPadRight | rbxasset://textures/ui/Controls/dpadRight.png |
KeyCode.DPadUp | rbxasset://textures/ui/Controls/dpadUp.png |
KeyCode.DPadDown | rbxasset://textures/ui/Controls/dpadDown.png |
KeyCode.ButtonSelect | rbxasset://textures/ui/Controls/xboxView.png |
KeyCode.ButtonStart | rbxasset://textures/ui/Controls/xboxmenu.png |
KeyCode.ButtonL1 | rbxasset://textures/ui/Controls/xboxLB.png |
KeyCode.ButtonR1 | rbxasset://textures/ui/Controls/xboxRB.png |
KeyCode.ButtonL2 | rbxasset://textures/ui/Controls/xboxLT.png |
KeyCode.ButtonR2 | rbxasset://textures/ui/Controls/xboxRT.png |
KeyCode.ButtonL3 | rbxasset://textures/ui/Controls/xboxLS.png |
KeyCode.ButtonR3 | rbxasset://textures/ui/Controls/xboxRS.png |
KeyCode.Thumbstick1 | rbxasset://textures/ui/Controls/xboxLSDirectional.png |
KeyCode.Thumbstick2 | rbxasset://textures/ui/Controls/xboxRSDirectional.png |
KeyCode.Backspace | rbxasset://textures/ui/Controls/backspace.png |
KeyCode.Return | rbxasset://textures/ui/Controls/return.png |
KeyCode.LeftShift | rbxasset://textures/ui/Controls/shift.png |
KeyCode.RightShift | rbxasset://textures/ui/Controls/shift.png |
KeyCode.Tab | rbxasset://textures/ui/Controls/tab.png |
KeyCode.Quote | rbxasset://textures/ui/Controls/apostrophe.png |
KeyCode.Comma | rbxasset://textures/ui/Controls/comma.png |
KeyCode.Backquote | rbxasset://textures/ui/Controls/graveaccent.png |
KeyCode.Period | rbxasset://textures/ui/Controls/period.png |
KeyCode.Space | rbxasset://textures/ui/Controls/spacebar.png |
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetStringForKeyCode from to Unsafe
- 379 Add GetStringForKeyCode
GetSupportedGamepadKeyCodes
Parameters (1) | ||
---|---|---|
gamepadNum | UserInputType | |
Returns (1) | ||
Array |
This method returns an array of KeyCodes that the gamepad associated with the given UserInputType supports. If called on a non‑connected gamepad, returns an empty array.
To determine if a specific KeyCode is supported, use GamepadSupports().
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of GetSupportedGamepadKeyCodes from to Unsafe
- 185 Add GetSupportedGamepadKeyCodes
GetUserCFrame
Parameters (1) | ||
---|---|---|
type | UserCFrame | |
Returns (1) | ||
CFrame |
The UserInputService:GetUserCFrame() method returns a CFrame describing the position and orientation of a specified UserCFrame virtual reality (VR) device. If the specified device is not connected, the method returns CFrame.new().
For example, the code snippet below prints the CFrame of the user's VR headset.
1 2 3 4 |
|
By using the method, players can implement features such as re-positioning the user's in-game character corresponding to the location of a connected VR device. This can be done by changing the CFrame of the user's in-game body parts to match the CFrame of the specified VR device using UserCFrame and CFrame value arguments passed by the event.
See also:
- UserInputService.UserCFrameChanged, an event which fires when the CFrame of a VR device changes
- VRService, a service used to implement VR support
As this event only fires locally, it can only be used in a LocalScript.
Thread safety | Unsafe |
---|
History 4
- 605 Change Tags of GetUserCFrame from [] to [Deprecated]
- 605 Change PreferredDescriptor of GetUserCFrame from to GetUserCFrame
- 462 Change ThreadSafety of GetUserCFrame from to Unsafe
- 236 Add GetUserCFrame
GyroscopeEnabled
Type | Default | |
---|---|---|
bool |
This property describes whether the user's device has a gyroscope, a component found in most mobile devices that detects orientation and rotational speed.
If the device has a gyroscope, you can incorporate it into your experience using the GetDeviceRotation() method or track when the device's rotation changes through the DeviceRotationChanged event.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
History 4
- 553 Change Default of GyroscopeEnabled from to
- 486 Change ThreadSafety of GyroscopeEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of GyroscopeEnabled from to ReadOnly
- 168 Add GyroscopeEnabled
InputBegan
Parameters (2) | |
---|---|
input | InputObject |
gameProcessedEvent | bool |
This event fires when a user begins interacting with an input device such as a mouse or gamepad, such as when they first interact with a gamepad button, although it does not capture mouse wheel movements. Can be used along with InputChanged and InputEnded to track when user input begins, changes, and ends.
See also InputBinding as a way to hook input device interactions to InputActions.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 6
- 483 Change Parameters of InputBegan from (input: Instance, gameProcessedEvent: bool) to (input: InputObject, gameProcessedEvent: bool)
- 462 Change ThreadSafety of InputBegan from to Unsafe
- 161 Change Parameters of InputBegan from (input: Instance) to (input: Instance, gameProcessedEvent: bool)
- 138 Change Security of InputBegan from RobloxScriptSecurity to None
- 133 Change Parameters of InputBegan from (input: InputObject) to (input: Instance)
- 128 Add InputBegan
InputChanged
Parameters (2) | |
---|---|
input | InputObject |
gameProcessedEvent | bool |
This event fires when a user changes how they're interacting with an input device such as a mouse or gamepad. Can be used along with InputBegan and InputEnded to track when user input begins, changes, and ends.
See also InputBinding as a way to hook input device interactions to InputActions.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 6
- 483 Change Parameters of InputChanged from (input: Instance, gameProcessedEvent: bool) to (input: InputObject, gameProcessedEvent: bool)
- 462 Change ThreadSafety of InputChanged from to Unsafe
- 161 Change Parameters of InputChanged from (input: Instance) to (input: Instance, gameProcessedEvent: bool)
- 138 Change Security of InputChanged from RobloxScriptSecurity to None
- 133 Change Parameters of InputChanged from (input: InputObject) to (input: Instance)
- 128 Add InputChanged
InputEnded
Parameters (2) | |
---|---|
input | InputObject |
gameProcessedEvent | bool |
This event fires when a user stops interacting with an input device such as a mouse or gamepad, such as when they release a gamepad button. Can be used along with InputBegan and InputChanged to track when user input begins, changes, and ends.
See also InputBinding as a way to hook input device interactions to InputActions.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 6
- 483 Change Parameters of InputEnded from (input: Instance, gameProcessedEvent: bool) to (input: InputObject, gameProcessedEvent: bool)
- 462 Change ThreadSafety of InputEnded from to Unsafe
- 161 Change Parameters of InputEnded from (input: Instance) to (input: Instance, gameProcessedEvent: bool)
- 138 Change Security of InputEnded from RobloxScriptSecurity to None
- 133 Change Parameters of InputEnded from (input: InputObject) to (input: Instance)
- 128 Add InputEnded
IsGamepadButtonDown
Parameters (2) | ||
---|---|---|
gamepadNum | UserInputType | |
gamepadKeyCode | KeyCode | |
Returns (1) | ||
bool |
This method returns true
if a particular button is pressed on a gamepad,
otherwise returns false
.
See also InputBinding as a way to hook gamepad and other input interactions to InputActions.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of IsGamepadButtonDown from to Unsafe
- 330 Add IsGamepadButtonDown
IsKeyDown
Parameters (1) | ||
---|---|---|
keyCode | KeyCode | |
Returns (1) | ||
bool |
This method returns true
if a particular key is pressed on a keyboard,
otherwise returns false
.
See also InputBinding as a way to hook key and other input interactions to InputActions.
Thread safety | Unsafe |
---|
IsMouseButtonPressed
Parameters (1) | ||
---|---|---|
mouseButton | UserInputType | |
Returns (1) | ||
bool |
This method returns true
if a particular mouse button is pressed,
otherwise returns false
.
See also InputBinding as a way to hook mouse button and other input interactions to InputActions.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of IsMouseButtonPressed from to Unsafe
- 297 Add IsMouseButtonPressed
JumpRequest
Parameters (0) | ||
---|---|---|
No parameters. |
This event fires when there is a jump request from the client, for example
when the client presses the spacebar or jump button on mobile. Default
behavior is to set the player's Humanoid.Jump property to true
which makes the player's character jump.
Since this event fires multiple times for a single jump request, using a debounce is recommended.
Thread safety | Unsafe |
---|
History 3
- 462 Change ThreadSafety of JumpRequest from to Unsafe
- 118 Change Security of JumpRequest from RobloxPlaceSecurity to None
- 113 Add JumpRequest
KeyboardEnabled
Type | Default | |
---|---|---|
bool |
This property describes whether the user's device has a keyboard
available. If true
, you can use key‑related methods such as
IsKeyDown() or
GetKeysPressed().
For seamless cross-platform compatibility on mixed-input devices, see PreferredInput which more accurately reflects which input (mouse/keyboard, touch, gamepad, etc.) the player is likely using as the primary input.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
History 6
- 553 Change Default of KeyboardEnabled from to
- 486 Change ThreadSafety of KeyboardEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of KeyboardEnabled from to ReadOnly
- 80 Add KeyboardEnabled
- 79 Remove UserInputService
- 80 Add KeyboardEnabled
LastInputTypeChanged
Parameters (1) | |
---|---|
lastInputType | UserInputType |
This event fires whenever the client's UserInputType is changed.
To get the value of the last input type, regardless of whether it has changed, use the GetLastInputType() method.
Thread safety | Unsafe |
---|
History 3
- 462 Change ThreadSafety of LastInputTypeChanged from to Unsafe
- 226 Change Security of LastInputTypeChanged from RobloxScriptSecurity to None
- 208 Add LastInputTypeChanged
ModalEnabled
Type | Default | |
---|---|---|
bool |
The ModalEnabled
property determines whether character controls are
hidden on TouchEnabled devices. By
default, this property is false
and controls are visible.
This property will only work when used in a LocalScript running for the player whose character controls are to be hidden.
Even if mobile controls are hidden for a player on a touch‑enabled device, other events such as InputBegan and TouchSwipe can still be used to process other forms of input.
Thread safety | ReadSafe |
---|---|
Category | Behavior |
Loaded/Saved | false |
History 6
- 553 Change PreferredDescriptor of ModalEnabled from to TouchControlsEnabled
- 553 Change Default of ModalEnabled from to
- 493 Change Tags of ModalEnabled from [] to [Deprecated]
- 486 Change ThreadSafety of ModalEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of ModalEnabled from to ReadOnly
- 118 Add ModalEnabled
MouseBehavior
Type | Default | |
---|---|---|
MouseBehavior |
This property sets how the user's mouse behaves based on the MouseBehavior enum. It can be set to three values:
- MouseBehavior.Default — The mouse moves freely around the user's screen.
- MouseBehavior.LockCenter — The mouse is locked and cannot move from the center of the user's screen.
- MouseBehavior.LockCurrentPosition — The mouse is locked and cannot move from its current position on the user's screen at the time of locking.
The value of this property does not affect the sensitivity of events tracking mouse movement. For example, GetMouseDelta returns the same Vector2 screen position in pixels regardless of whether the mouse is locked or able to move freely around the user's screen. As a result, default scripts like those controlling the camera are not impacted by this property.
This property is overridden if a GuiButton with Modal enabled is Visible unless the player's right mouse button is down.
Note that if the mouse is locked, InputChanged will still fire when the player moves the mouse and will pass in the delta that the mouse attempted to move by. Additionally, if the player is kicked from the experience, the mouse will be forcefully unlocked.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of MouseBehavior from to
- 486 Change ThreadSafety of MouseBehavior from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MouseBehavior from to ReadOnly
- 158 Add MouseBehavior
MouseDeltaSensitivity
Type | Default | |
---|---|---|
float |
This property determines the sensitivity of the user's Mouse. It can be used to adjust the sensitivity of events tracking mouse movement, such as GetMouseDelta().
This property does not affect the movement of the mouse icon, nor the camera sensitivity that the user has selected for their client.
This property has a maximum value of 10
and a minimum value of 0
. When
sensitivity is 0
, events that track the mouse's movement will still fire
but all parameters and properties indicating the change in mouse position
will return 0
.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true/false |
History 4
- 553 Change Default of MouseDeltaSensitivity from to
- 486 Change ThreadSafety of MouseDeltaSensitivity from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MouseDeltaSensitivity from to ReadOnly
- 246 Add MouseDeltaSensitivity
MouseEnabled
Type | Default | |
---|---|---|
bool |
This property describes whether the user's device has a mouse available.
If true
, you can use mouse‑related methods such as
GetMouseLocation().
For seamless cross-platform compatibility on mixed-input devices, see PreferredInput which more accurately reflects which input (mouse/keyboard, touch, gamepad, etc.) the player is likely using as the primary input.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
History 6
- 553 Change Default of MouseEnabled from to
- 486 Change ThreadSafety of MouseEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MouseEnabled from to ReadOnly
- 80 Add MouseEnabled
- 79 Remove UserInputService
- 80 Add MouseEnabled
MouseIcon
Type | Default | |
---|---|---|
ContentId |
This property determines the content ID of the image for the user's mouse icon. If blank, a default arrow pointer is used. While the cursor hovers over certain UI objects such as an ImageButton, TextButton, TextBox, or ProximityPrompt, this image will be overridden and temporarily ignored.
To hide the cursor entirely, do not use a transparent image; instead,
set MouseIconEnabled to false
.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
MouseIconEnabled
Type | Default | |
---|---|---|
bool |
This property determines whether the mouse icon is visible.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | true |
History 4
- 553 Change Default of MouseIconEnabled from to
- 486 Change ThreadSafety of MouseIconEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of MouseIconEnabled from to ReadOnly
- 158 Add MouseIconEnabled
OnScreenKeyboardPosition
Type | Default | |
---|---|---|
Vector2 |
This property describes the position of the on-screen keyboard in pixels. The keyboard's position is Vector2.new(0, 0) when it is not visible.
See also OnScreenKeyboardVisible and OnScreenKeyboardSize.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 4
- 553 Change Default of OnScreenKeyboardPosition from to
- 486 Change ThreadSafety of OnScreenKeyboardPosition from ReadOnly to ReadSafe
- 462 Change ThreadSafety of OnScreenKeyboardPosition from to ReadOnly
- 281 Add OnScreenKeyboardPosition
OnScreenKeyboardSize
Type | Default | |
---|---|---|
Vector2 |
This property describes the size of the on-screen keyboard in pixels. The keyboard's size is Vector2.new(0, 0) when it is not visible.
See also OnScreenKeyboardVisible and OnScreenKeyboardPosition.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 4
- 553 Change Default of OnScreenKeyboardSize from to
- 486 Change ThreadSafety of OnScreenKeyboardSize from ReadOnly to ReadSafe
- 462 Change ThreadSafety of OnScreenKeyboardSize from to ReadOnly
- 281 Add OnScreenKeyboardSize
OnScreenKeyboardVisible
Type | Default | |
---|---|---|
bool |
This property describes whether an on-screen keyboard is currently visible on the user's screen.
See also OnScreenKeyboardSize and OnScreenKeyboardPosition.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 4
- 553 Change Default of OnScreenKeyboardVisible from to
- 486 Change ThreadSafety of OnScreenKeyboardVisible from ReadOnly to ReadSafe
- 462 Change ThreadSafety of OnScreenKeyboardVisible from to ReadOnly
- 281 Add OnScreenKeyboardVisible
PointerAction
Parameters (4) | |
---|---|
wheel | float |
pan | Vector2 |
pinch | float |
gameProcessedEvent | bool |
This event fires when the user performs a specific pointer action
(wheel
, pan
, pitch
).
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of PointerAction from to Unsafe
- 398 Add PointerAction
PreferredInput
Type | Default | |
---|---|---|
PreferredInput |
This read-only property lets you query the primary input type a player is likely using, based on anticipated user behavior, to ensure UI elements like on‑screen buttons and menus work elegantly across devices. For example, a touch‑enabled device assumes touch is the default input and that touch buttons may appear for actions, but if a player connects an additional bluetooth keyboard/mouse or gamepad, you can assume they want to switch to that as the primary input type and possibly use touch as a backup input for on‑screen UI.
The behavior of PreferredInput
is summarized in the following table. Its
value changes based on the value of legacy UserInputService
properties such as
KeyboardEnabled,
GamepadEnabled, and
TouchEnabled, as well as the
player's most recent interaction with a connected gamepad or
keyboard/mouse.
KeyboardEnabled; GamepadEnabled; TouchEnabled | Most Recent Interaction | PreferredInput | Example |
---|---|---|---|
false ; false ; true | (don't care) | Touch | ⒜ |
true ; false ; (don't care) | (don't care) | KeyboardAndMouse | ⒝ |
false ; true ; (don't care) | (don't care) | Gamepad | ⒞ |
true ; true ; (don't care) | Keyboard or Mouse | KeyboardAndMouse | ⒟ |
true ; true ; (don't care) | Gamepad | Gamepad | ⒠ |
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
History 1
- 675 Add PreferredInput
RecenterUserHeadCFrame
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
null |
This method recenters the CFrame of the VR headset to the current orientation of the headset worn by the user. This means that the headset's current orientation is set to CFrame.new().
This method behaves identically to the VRService method RecenterUserHeadCFrame().
Thread safety | Unsafe |
---|
History 3
- 573 Change ReturnType of RecenterUserHeadCFrame from void to null
- 462 Change ThreadSafety of RecenterUserHeadCFrame from to Unsafe
- 234 Add RecenterUserHeadCFrame
SendAppUISizes
Parameters (4) | ||
---|---|---|
statusBarSize | Vector2 | |
navBarSize | Vector2 | |
bottomBarSize | Vector2 | |
rightBarSize | Vector2 | |
Returns (1) | ||
null |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 4
- 573 Change ReturnType of SendAppUISizes from void to null
- 462 Change ThreadSafety of SendAppUISizes from to Unsafe
- 360 Change Parameters of SendAppUISizes from (statusBarSize: Vector2, navBarSize: Vector2, bottomBarSize: Vector2) to (statusBarSize: Vector2, navBarSize: Vector2, bottomBarSize: Vector2, rightBarSize: Vector2)
- 315 Add SendAppUISizes
StatusBarTapped
Parameters (1) | |
---|---|
position | Vector2 |
Security | RobloxScriptSecurity |
---|---|
Thread safety | Unsafe |
History 2
- 462 Change ThreadSafety of StatusBarTapped from to Unsafe
- 322 Add StatusBarTapped
TextBoxFocusReleased
Parameters (1) | |
---|---|
textboxReleased | TextBox |
This event fires when the client loses focus on a TextBox, typically when a user stops text entry by pressing Enter or clicking/touching elsewhere on the screen. Can be used alongside TextBoxFocused to track when a TextBox gains focus.
See also GetFocusedTextBox(), TextBox.Focused, and TextBox.FocusLost.
Thread safety | Unsafe |
---|
History 3
- 483 Change Parameters of TextBoxFocusReleased from (textboxReleased: Instance) to (textboxReleased: TextBox)
- 462 Change ThreadSafety of TextBoxFocusReleased from to Unsafe
- 161 Add TextBoxFocusReleased
TextBoxFocused
Parameters (1) | |
---|---|
textboxFocused | TextBox |
This event fires when the client gains focus on a TextBox, typically when a user clicks/taps it to begin inputting text. Also fires if the TextBox is focused using TextBox:CaptureFocus(). Can be used alongside TextBoxFocusReleased to track when a TextBox loses focus.
See also GetFocusedTextBox(), TextBox.Focused, and TextBox.FocusLost.
Thread safety | Unsafe |
---|
History 3
- 483 Change Parameters of TextBoxFocused from (textboxFocused: Instance) to (textboxFocused: TextBox)
- 462 Change ThreadSafety of TextBoxFocused from to Unsafe
- 161 Add TextBoxFocused
TouchDrag
Parameters (3) | |
---|---|
dragDirection | SwipeDirection |
numberOfTouches | int |
gameProcessedEvent | bool |
This event fires when the user drags on the screen of a TouchEnabled device.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
TouchEnabled
Type | Default | |
---|---|---|
bool |
This property describes whether the user's device has a touch screen
available. If true
, you can use touch‑related events such as
TouchStarted and
TouchMoved.
For seamless cross-platform compatibility on mixed-input devices, see PreferredInput which more accurately reflects which input (mouse/keyboard, touch, gamepad, etc.) the player is likely using as the primary input.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
History 6
- 553 Change Default of TouchEnabled from to
- 486 Change ThreadSafety of TouchEnabled from ReadOnly to ReadSafe
- 462 Change ThreadSafety of TouchEnabled from to ReadOnly
- 80 Add TouchEnabled
- 79 Remove UserInputService
- 80 Add TouchEnabled
TouchEnded
Parameters (2) | |
---|---|
touch | InputObject |
gameProcessedEvent | bool |
This event fires when a user releases their finger from the screen of a TouchEnabled device. Can be paired with TouchStarted to determine when a user starts and stops touching the screen.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 7
- 483 Change Parameters of TouchEnded from (touch: Instance, gameProcessedEvent: bool) to (touch: InputObject, gameProcessedEvent: bool)
- 462 Change ThreadSafety of TouchEnded from to Unsafe
- 161 Change Parameters of TouchEnded from (touch: Instance) to (touch: Instance, gameProcessedEvent: bool)
- 138 Change Security of TouchEnded from RobloxScriptSecurity to None
- 133 Change Parameters of TouchEnded from (touch: InputObject) to (touch: Instance)
- 128 Change Security of TouchEnded from RobloxSecurity to RobloxScriptSecurity
- 113 Add TouchEnded
TouchLongPress
Parameters (3) | |
---|---|
touchPositions | Array |
state | UserInputState |
gameProcessedEvent | bool |
This event fires when a user holds at least one finger for a short amount of time on the screen of a TouchEnabled device.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 8
- 462 Change ThreadSafety of TouchLongPress from to Unsafe
- 161 Change Parameters of TouchLongPress from (touchPositions: Array, state: UserInputState) to (touchPositions: Array, state: UserInputState, gameProcessedEvent: bool)
- 138 Change Security of TouchLongPress from RobloxScriptSecurity to None
- 131 Change Parameters of TouchLongPress from (position: UserInputState, state: Vector2) to (touchPositions: Array, state: UserInputState)
- 130 Change Parameters of TouchLongPress from (position: Vector2, state: UserInputState) to (position: UserInputState, state: Vector2)
- 128 Change Security of TouchLongPress from RobloxSecurity to RobloxScriptSecurity
- 128 Change Parameters of TouchLongPress from (position: Vector2) to (position: Vector2, state: UserInputState)
- 113 Add TouchLongPress
TouchMoved
Parameters (2) | |
---|---|
touch | InputObject |
gameProcessedEvent | bool |
This event fires when a user moves their finger on the screen of a TouchEnabled device, useful for tracking whether a user is moving their finger on the screen and where they're moving it. Can be paired with TouchStarted and TouchEnded to determine when a user starts touching the screen, how their finger moves while touching it, and when the they stop touching the screen.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 7
- 483 Change Parameters of TouchMoved from (touch: Instance, gameProcessedEvent: bool) to (touch: InputObject, gameProcessedEvent: bool)
- 462 Change ThreadSafety of TouchMoved from to Unsafe
- 161 Change Parameters of TouchMoved from (touch: Instance) to (touch: Instance, gameProcessedEvent: bool)
- 138 Change Security of TouchMoved from RobloxScriptSecurity to None
- 133 Change Parameters of TouchMoved from (touch: InputObject) to (touch: Instance)
- 128 Change Security of TouchMoved from RobloxSecurity to RobloxScriptSecurity
- 113 Add TouchMoved
TouchPan
Parameters (5) | |
---|---|
touchPositions | Array |
totalTranslation | Vector2 |
velocity | Vector2 |
state | UserInputState |
gameProcessedEvent | bool |
This event fires when the user drags at least one finger on the screen of a TouchEnabled device.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 5
- 462 Change ThreadSafety of TouchPan from to Unsafe
- 161 Change Parameters of TouchPan from (touchPositions: Array, totalTranslation: Vector2, velocity: Vector2, state: UserInputState) to (touchPositions: Array, totalTranslation: Vector2, velocity: Vector2, state: UserInputState, gameProcessedEvent: bool)
- 138 Change Security of TouchPan from RobloxScriptSecurity to None
- 131 Change Parameters of TouchPan from (totalTranslation: Vector2, velocity: Vector2, numberOfTouches: int, state: UserInputState, position: Vector2) to (touchPositions: Array, totalTranslation: Vector2, velocity: Vector2, state: UserInputState)
- 130 Add TouchPan
TouchPinch
Parameters (5) | |
---|---|
touchPositions | Array |
scale | float |
velocity | float |
state | UserInputState |
gameProcessedEvent | bool |
This event fires when a user performs a pinch gesture on the screen of a TouchEnabled device.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 7
- 462 Change ThreadSafety of TouchPinch from to Unsafe
- 161 Change Parameters of TouchPinch from (touchPositions: Array, scale: float, velocity: float, state: UserInputState) to (touchPositions: Array, scale: float, velocity: float, state: UserInputState, gameProcessedEvent: bool)
- 138 Change Security of TouchPinch from RobloxScriptSecurity to None
- 131 Change Parameters of TouchPinch from (scale: float, velocity: float, state: UserInputState, position: Vector2) to (touchPositions: Array, scale: float, velocity: float, state: UserInputState)
- 130 Change Parameters of TouchPinch from (scale: float, velocity: float) to (scale: float, velocity: float, state: UserInputState, position: Vector2)
- 128 Change Security of TouchPinch from RobloxSecurity to RobloxScriptSecurity
- 113 Add TouchPinch
TouchRotate
Parameters (5) | |
---|---|
touchPositions | Array |
rotation | float |
velocity | float |
state | UserInputState |
gameProcessedEvent | bool |
This event fires when a user rotates two fingers on the screen of a TouchEnabled device.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 7
- 462 Change ThreadSafety of TouchRotate from to Unsafe
- 161 Change Parameters of TouchRotate from (touchPositions: Array, rotation: float, velocity: float, state: UserInputState) to (touchPositions: Array, rotation: float, velocity: float, state: UserInputState, gameProcessedEvent: bool)
- 138 Change Security of TouchRotate from RobloxScriptSecurity to None
- 131 Change Parameters of TouchRotate from (rotation: float, velocity: float, state: UserInputState, position: Vector2) to (touchPositions: Array, rotation: float, velocity: float, state: UserInputState)
- 130 Change Parameters of TouchRotate from (rotation: float, velocity: float) to (rotation: float, velocity: float, state: UserInputState, position: Vector2)
- 128 Change Security of TouchRotate from RobloxSecurity to RobloxScriptSecurity
- 113 Add TouchRotate
TouchStarted
Parameters (2) | |
---|---|
touch | InputObject |
gameProcessedEvent | bool |
This event fires when a user places their finger on the screen of a TouchEnabled device. Can be paired with TouchEnded to determine when a user starts and stops touching the screen.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 7
- 483 Change Parameters of TouchStarted from (touch: Instance, gameProcessedEvent: bool) to (touch: InputObject, gameProcessedEvent: bool)
- 462 Change ThreadSafety of TouchStarted from to Unsafe
- 161 Change Parameters of TouchStarted from (touch: Instance) to (touch: Instance, gameProcessedEvent: bool)
- 138 Change Security of TouchStarted from RobloxScriptSecurity to None
- 133 Change Parameters of TouchStarted from (touch: InputObject) to (touch: Instance)
- 128 Change Security of TouchStarted from RobloxSecurity to RobloxScriptSecurity
- 113 Add TouchStarted
TouchSwipe
Parameters (3) | |
---|---|
swipeDirection | SwipeDirection |
numberOfTouches | int |
gameProcessedEvent | bool |
This event fires on a TouchEnabled device when a user places their finger(s) down on the screen, pans across the screen, and lifts their finger(s) off with a certain speed of movement.
For more precise tracking of touch input movement, use TouchMoved.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 6
- 462 Change ThreadSafety of TouchSwipe from to Unsafe
- 161 Change Parameters of TouchSwipe from (swipeDirection: SwipeDirection, numberOfTouches: int) to (swipeDirection: SwipeDirection, numberOfTouches: int, gameProcessedEvent: bool)
- 138 Change Security of TouchSwipe from RobloxScriptSecurity to None
- 128 Change Security of TouchSwipe from RobloxSecurity to RobloxScriptSecurity
- 128 Change Parameters of TouchSwipe from (swipeDirection: SwipeDirection) to (swipeDirection: SwipeDirection, numberOfTouches: int)
- 113 Add TouchSwipe
TouchTap
Parameters (2) | |
---|---|
touchPositions | Array |
gameProcessedEvent | bool |
This event fires when a user taps their finger on the screen of a TouchEnabled device, regardless of whether the user taps in the 3D world or on a GuiObject element. If you're looking for an event that only fires when the user taps in the 3D world, use TouchTapInWorld.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 6
- 462 Change ThreadSafety of TouchTap from to Unsafe
- 161 Change Parameters of TouchTap from (touchPositions: Array) to (touchPositions: Array, gameProcessedEvent: bool)
- 138 Change Security of TouchTap from RobloxScriptSecurity to None
- 131 Change Parameters of TouchTap from (position: Vector2) to (touchPositions: Array)
- 128 Change Security of TouchTap from RobloxSecurity to RobloxScriptSecurity
- 113 Add TouchTap
TouchTapInWorld
Parameters (2) | |
---|---|
position | Vector2 |
processedByUI | bool |
This event fires when a user taps their finger on the screen of a TouchEnabled device and the tap location is in the 3D world rather than on a GuiObject element.
Note that this event only fires when the Roblox client window is in focus. It will not fire when the window is minimized.
Thread safety | Unsafe |
---|
History 2
- 462 Change ThreadSafety of TouchTapInWorld from to Unsafe
- 297 Add TouchTapInWorld
UserCFrameChanged
Parameters (2) | |
---|---|
type | UserCFrame |
value | CFrame |
The UserCFrameChanged event fires when the CFrame of a VR device changes.
This event can be used to track the movement of a connected VR device.
Using the event, you can implement features such as moving the user's in-game character limbs as the user moves their VR device. This can be done by changing the CFrame of the user's in-game limbs to match the CFrame changes of the VR device using the UserCFrame enum and CFrame value arguments passed by the event.
To retrieve the CFrame of a connected VR device, use UserInputService:GetUserCFrame().
As the event fires locally, it can only be used in a LocalScript.
See also:
- VRService, used to implement support, including an identical event VRService.UserHeadCFrameChanged
- Camera.HeadLocked, when this property is
true
the Camera will automatically track the head motion of a player using a VR device - Camera:GetRenderCFrame(), a method which retrieves the CFrame the Camera is being orientated at, including the impact of VR devices
Thread safety | Unsafe |
---|
History 4
- 605 Change Tags of UserCFrameChanged from [] to [Deprecated]
- 605 Change PreferredDescriptor of UserCFrameChanged from to UserCFrameChanged
- 462 Change ThreadSafety of UserCFrameChanged from to Unsafe
- 236 Add UserCFrameChanged
UserHeadCFrame
Type | Default | |
---|---|---|
CFrame |
The UserHeadCFrame used to describe the orientation and position of a user's head, if they are actively using a virtual reality headset.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false |
History 5
- 553 Change Default of UserHeadCFrame from to
- 486 Change ThreadSafety of UserHeadCFrame from ReadOnly to ReadSafe
- 462 Change ThreadSafety of UserHeadCFrame from to ReadOnly
- 236 Change Tags of UserHeadCFrame from [ReadOnly, NotReplicated] to [ReadOnly, NotReplicated, Deprecated]
- 229 Add UserHeadCFrame
VREnabled
Type | Default | |
---|---|---|
bool |
This property describes whether the user is using a virtual reality (VR)
device. If true
, you can use VR‑related properties, methods, and events
in VRService.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
WindowFocusReleased
Parameters (0) | ||
---|---|---|
No parameters. |
This event fires when the window of the Roblox client loses focus, typically when it is minimized by the user. Can be used alongside WindowFocused to track when the client gains focus on a user's screen.
Thread safety | Unsafe |
---|
History 4
- 462 Change ThreadSafety of WindowFocusReleased from to Unsafe
- 189 Add WindowFocusReleased
- 188 Remove WindowFocusReleased
- 189 Add WindowFocusReleased
WindowFocused
Parameters (0) | ||
---|---|---|
No parameters. |
This event fires when the window of the Roblox client gains focus, typically when it is maximized or actively opened by the user. Can be used alongside WindowFocusReleased to track when the client loses focus on a user's screen.
Thread safety | Unsafe |
---|
History 4
- 462 Change ThreadSafety of WindowFocused from to Unsafe
- 189 Add WindowFocused
- 188 Remove WindowFocused
- 189 Add WindowFocused
Removed members 10
InCameraGesture
Type | Default | |
---|---|---|
bool |
Security | RobloxScriptSecurity |
---|---|
Category | |
Loaded/Saved | false |
History 2
- 220 Remove InCameraGesture
- 150 Add InCameraGesture
IsLuaTouchControls
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
bool |
Security | RobloxScriptSecurity |
---|
History 2
- 230 Remove IsLuaTouchControls
- 131 Add IsLuaTouchControls
IsStudioTouchEmulationEnabled
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
bool |
Security | RobloxScriptSecurity |
---|
History 2
IsVREnabled
Type | Default | |
---|---|---|
bool |
Category | |
---|---|
Loaded/Saved | false |
History 3
- 240 Remove IsVREnabled
- 230 Change Tags of IsVREnabled from [ReadOnly] to [ReadOnly, Deprecated]
- 229 Add IsVREnabled
OverrideMouseIconEnabled
Type | Default | |
---|---|---|
bool |
Security | RobloxScriptSecurity |
---|---|
Category | |
Loaded/Saved | false |
History 2
ProcessedEvent
Parameters (2) | |
---|---|
inputObject | Instance |
processed | bool |
Security | RobloxScriptSecurity |
---|
History 2
- 230 Remove ProcessedEvent
- 143 Add ProcessedEvent
RotateCamera
Parameters (1) | ||
---|---|---|
positionDelta | Vector2 | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 230 Remove RotateCamera
- 131 Add RotateCamera
TouchControlsEnabled
Type | Default | |
---|---|---|
bool |
Security | RobloxPlaceSecurity |
---|---|
Category | |
Loaded/Saved | false |
History 2
- 118 Remove TouchControlsEnabled
- 115 Add TouchControlsEnabled
ZoomCamera
Parameters (1) | ||
---|---|---|
zoomDelta | float | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 230 Remove ZoomCamera
- 131 Add ZoomCamera