Detecting gamepads aside from XBOX and PLAYSTATION

So as you can see from the title, I was wondering if there was a way to detect gamepads that aren’t Xbox and Playstation gamepads. For example, I have a “nintendo pro controller” that does work in roblox and studio, but studio does not offer any ways that I know of to detect the said controller. I have tried messing with the keystrokes and their strings but still couldn’t get it to work. I found out that roblox automatically changes the keystroke to detect it in a “nintendo layout” instead of a xbox one. Thanks.

1 Like

Maybe something like

local IsExternalGamepad = UserInputService.GamepadEnabled and not GuiService:IsTenFootInterface()

I believe this would detect any gamepad that isn’t on a console

Yes, but the problem im asking is that I want to be able to detect unsupported gamepads and change the button icons accordingly.

Why do you even need this if I may ask?

Roblox is available on only these platforms: Windows, macOS, iOS, Android, Xbox, Meta Quest, and PlayStation.

I don’t see why you would be needing Nintendo as it’s not even available there.

I know, but I just want to add support for the unsupported gamepads anyway. Its not confortable because the buttons are swapped, which is why I made this post. Also the fact roblox does support nintendo gamepads makes it a possibility of support being added in studio.

Your computer* (partially) supports Nintendo gamepads.

According to this documentation, it is not possible to detect gamepads other than the Xbox and PlayStation. Some games have the option to let you switch between gamepad icons - I would recommend doing that instead.

I guess I could make a switch gamepads option but I just don’t know how to make key binds work yet.

For starters, all gamepads’ Enum.KeyCodes are the same. How the inputs correlate with the location of the button depends on their gamepad drivers. For example, I believe BetterJoy, a gamepad driver for Nintendo controllers, converts inputs to a standard Xbox gamepad and will follow that schema, flipping A/B and X/Y on the Switch controllers.

Like I said in my post, roblox does recognize my nintendo controllers and automatically converts the inputs so that you don’t have to press the swapped key and misread the button icon (which only applies in some games). The problem with this is that it still uses the xbox icon layout. I did not use any gamepad drivers whatsoever.

you cant. the only thing i can think of is using this code:

local userInputService = game:GetService("UserInputService")
local buttonA = Enum.KeyCode.ButtonA

local str = userInputService:GetStringForKeyCode(buttonA)
local isXbox = str == "ButtonA" 
local isPlayStation = str == "ButtonCross" 


if isXbox then
   print("playing on RizzBox")
elseif isPlayStation then
   print("playing on SigmaStation")
else
  print("playing on Copyrighted thing")
end

other than that, there is nothing you can do.

Enum.ButtonA will only ever return ButtonA or ButtonCross, so the else statement will never run

I alredy have this detection system in place but thanks anyway. Hopefully in the future they add more way to detect other gamepads