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.

GamepadType

Identifies the hardware type of a connected gamepad (for example PlayStation or Xbox). Detected when a gamepad connects. On console platforms the value is fixed to the platform's native controller type; elsewhere it reflects the most recently connected gamepad, defaulting to GamepadType.Unknown when none has connected or the type cannot be determined.

Use UserInputService:GetImageForKeyCode() to get an image representation of a KeyCode for a given gamepad.

Items

NameValueDescription
Unknown0A gamepad whose hardware type could not be determined, or no gamepad has connected yet.
PS41A Sony PlayStation 4 DualShock controller.
PS52A Sony PlayStation 5 DualSense controller.
XboxOne3A Microsoft Xbox One controller.

Unknown

A gamepad whose hardware type could not be determined, or no gamepad has connected yet.

FieldValue
value0

PS4

A Sony PlayStation 4 DualShock controller.

FieldValue
value1

PS5

A Sony PlayStation 5 DualSense controller.

FieldValue
value2

XboxOne

A Microsoft Xbox One controller.

FieldValue
value3