There’s no way to accurately detect it. There are various ways to make a guess, and I believe the only reliable way was patched.
One way I’ve heard is to use UserInputService:GetLastInputType()
, which returns an enum value indicating the type of input that was last used by the player. For example, if the player is using a keyboard or mouse, the method will return Enum.UserInputType.Keyboard
or Enum.UserInputType.MouseButton1
. However, if the player is using the UWP version of Roblox, the method will return Enum.UserInputType.Gamepad1
, regardless of the actual input device used. This is because the UWP version of Roblox emulates a gamepad input for compatibility reasons. This may have been patched - you’ll have to test it.
Let me know if it works. There’s also another devforum post on the same subject, but no one ever gave an answer.