Detect input device

Hi,

How can i detect from what device input is coming?
Like: keyboard and mice, xbox controller, PS controller or etc

Thanks in advance,

make an input action for left joystick (and you can add any other controller inputs as well) and make a second input action for wasd (or mouse or other keys) in the player blueprint, when the input action for the controller is used, set a boolean variable called UsingGamepad to true. when the input action event for the keyboard one is used, set that boolean variable to false. You can use branches with that boolean anywhere else in the blueprint where thats needed

FYI - This fires ALL THE TIME - with 0 Gamepad hooked up to the PC. This method doesnt work…

https://puu.sh/DQEN8/05ee8a83f0.png

Since all of the answers for this question i found were trash here’s mine:

  1. Use event “Any Key” to get a key pressed
  2. Use “Is keyboard key” on it to check if it’s a keyboard key
  3. Switch on the bool your functions to view the text or images.
    I’m using “get display name” straight from input settings so my mechanic is index dependant. Also used two branches in case i want more devices.

1 Like

In UE 5.3, using the Input Device Subsystem worked really well for me:

The Hardware Device Identifier comes back telling you the specific gamepad, if you want to switch between PlayStation and Xbox controller specific UI. For example, the keyboard and mouse returns “KBM” and an Xbox controller returns “XInputController”.

8 Likes

That’s so important, I can’t believe it didn’t exist until version 5.3.
Thank for your hint!

1 Like

On any key event you can call “is gamepad key” or “is keyboard key” ect…

Unreal’s input system is a joke (haven’t tried the Enhanced one yet).

PS: to save you the head banging - this function returns invalid result if the device NEVER made any input (because the data is populated on a button press for example). So Unreal knows there are devices, but doesn’t know what they are… brilliant…

God bless you <3