1 min read

Source: Roblox Creator Hub · CC BY 4.0 · View source · Code samples: MIT Imported 2026-10-03. Formatting adapted for this site.

PreferredInput

This enum is used with UserInputService.PreferredInput to indicate the primary input type a player is likely using.

Items

NameValueDescription
KeyboardAndMouse0The player has connected or most recently interacted with a keyboard or mouse.
Gamepad1The player has connected or most recently interacted with a gamepad.
Touch2The player's device has touch capability and no other input method is available or was recently interacted with.
MicroGamepad3The player has connected or most recently interacted with a gamepad without a thumbstick (for example, a TV remote or another limited-input gamepad), and no standard gamepad is currently connected.

KeyboardAndMouse

The player has connected or most recently interacted with a keyboard or mouse.

FieldValue
value0

Gamepad

The player has connected or most recently interacted with a gamepad.

FieldValue
value1

Touch

The player's device has touch capability and no other input method is available or was recently interacted with.

FieldValue
value2

MicroGamepad

The player has connected or most recently interacted with a gamepad without a thumbstick (for example, a TV remote or another limited-input gamepad), and no standard gamepad is currently connected.

FieldValue
value3