Download

Detect the model of Gamepad used

I’m using an action with AnyKey, to detect if keyboard or gamepad is used. When I detect that the Gamepad is used, I need to know the type of game pad to correctly show the icon on screen.

How can I know if the used Gamepad is the XBOX or PlayStation model?

Thanks in Advance.

Hey EpicOdino,

To begin, we do have a feature request in to expose the current input controller in the FKey data, used for input. You can follow it here:

https://issues.unrealengine.com/issue/UE-37186

Since it is backlogged, there is no way to know when it will be looked at. The good news is that UE4 uses a library called SDL ( Simple direct media layer ), which will expose an array of attached controllers. You can technically use this to get the type of contoller(s) attached to the computer at any given time, though it will take some effort on your end.

As an example, this user created a plugin that uses SDL to get joystick support:

https://github.com/tsky1971/UEJoystickPlugin/tree/MutlipleDevicesWithNames

This should give you a good example of where to start and how to get access to the connected controllers.

The answer I was hoping for, Thanks!!!

Any updates?

Also looking for updates

Hey,
Was wondering if there was an update on that. That issue link seems to not be available anymore. I also went into the SDL documentation and I can’t seem to find anything regarding generic controllers. I see the support for joysticks but not for anything else.
Thanks!

el bumpo
10 character limit