Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.
UserInputType
The UserInputType enum describes the kind of input being performed (mouse, keyboard, gamepad, touch, etc). This enum is used by the InputObject.UserInputType property of the same name, as well as various UserInputService and GuiObject events.
Items
| Name | Value | Description |
|---|---|---|
| MouseButton1 | 0 | The left mouse button. |
| MouseButton2 | 1 | The right mouse button. |
| MouseButton3 | 2 | The middle mouse button. |
| MouseWheel | 3 | The mouse wheel. |
| MouseMovement | 4 | Movement of the mouse. Fires changed events each time the player's cursor position changes and when the move enters/leaves the game window. |
| Touch | 7 | A tap on the screen from a mobile device. |
| Keyboard | 8 | Key press on a keyboard. |
| Focus | 9 | The client regaining focus of the Roblox window. |
| Accelerometer | 10 | The accelerometer of a mobile device. |
| Gyro | 11 | The Gyroscope of a mobile device. |
| Gamepad1 | 12 | Input from the 1st plugged in Gamepad. |
| Gamepad2 | 13 | Input from the 2nd plugged in Gamepad. |
| Gamepad3 | 14 | Input from the 3rd plugged in Gamepad. |
| Gamepad4 | 15 | Input from the 4th plugged in Gamepad. |
| Gamepad5 | 16 | Input from the 5th plugged in Gamepad. |
| Gamepad6 | 17 | Input from the 6th plugged in Gamepad. |
| Gamepad7 | 18 | Input from the 7th plugged in Gamepad. |
| Gamepad8 | 19 | Input from the 8th plugged in Gamepad. |
| TextInput | 20 | Input of Text into a text-based GuiObject. Normally this is only a TextBox. |
| InputMethod | 21 | Text input from an input method editor (IME). InputObjects with this type aren't currently fired. |
| None | 22 | Unknown UserInputType. |
MouseButton1
The left mouse button.
| Field | Value |
|---|---|
| value | 0 |
MouseButton2
The right mouse button.
| Field | Value |
|---|---|
| value | 1 |
MouseButton3
The middle mouse button.
| Field | Value |
|---|---|
| value | 2 |
MouseWheel
The mouse wheel.
| Field | Value |
|---|---|
| value | 3 |
MouseMovement
Movement of the mouse. Fires changed events each time the player's cursor position changes and when the move enters/leaves the game window.
| Field | Value |
|---|---|
| value | 4 |
Touch
A tap on the screen from a mobile device.
| Field | Value |
|---|---|
| value | 7 |
Keyboard
Key press on a keyboard.
| Field | Value |
|---|---|
| value | 8 |
Focus
The client regaining focus of the Roblox window.
| Field | Value |
|---|---|
| value | 9 |
Accelerometer
The accelerometer of a mobile device.
| Field | Value |
|---|---|
| value | 10 |
Gyro
The Gyroscope of a mobile device.
| Field | Value |
|---|---|
| value | 11 |
Gamepad1
Input from the 1st plugged in Gamepad.
| Field | Value |
|---|---|
| value | 12 |
Gamepad2
Input from the 2nd plugged in Gamepad.
| Field | Value |
|---|---|
| value | 13 |
Gamepad3
Input from the 3rd plugged in Gamepad.
| Field | Value |
|---|---|
| value | 14 |
Gamepad4
Input from the 4th plugged in Gamepad.
| Field | Value |
|---|---|
| value | 15 |
Gamepad5
Input from the 5th plugged in Gamepad.
| Field | Value |
|---|---|
| value | 16 |
Gamepad6
Input from the 6th plugged in Gamepad.
| Field | Value |
|---|---|
| value | 17 |
Gamepad7
Input from the 7th plugged in Gamepad.
| Field | Value |
|---|---|
| value | 18 |
Gamepad8
Input from the 8th plugged in Gamepad.
| Field | Value |
|---|---|
| value | 19 |
TextInput
Input of Text into a text-based GuiObject. Normally this is only a TextBox.
| Field | Value |
|---|---|
| value | 20 |
InputMethod
Text input from an input method editor (IME). InputObjects with this type aren't currently fired.
| Field | Value |
|---|---|
| value | 21 |
None
Unknown UserInputType.
| Field | Value |
|---|---|
| value | 22 |