Gamepad Connection Events
What is the recommended way to detect gamepad events? I'm thinking of the following scenarios:
Also, battery level would be nice. I'm interested in Windows only.
I did find a way to poll whether an Xbox controller is connected, although it may make your eyes bleed with terrible programming practice... (this needs to be implemented in C++)
At the top of your CPP file, add:
Then implement a function to return whether an Xbox gamepads are connected:
Huge disclaimer here though: This is not a good/sustainable/safe approach to solving this problem. Use at your own risk, and know that future updates of the engine could easily break this.
answered Oct 23 '15 at 04:11 PM
I've looked through the source and can say that events for gamepads connecting/disconnecting do not exist. XInput has an XInputGetBatteryInformation call that isn't plumbed. There's also no way to query the number of detected gamepads. There's quite a lot missing here.
answered Oct 14 '15 at 06:49 PM
Here is possible solution, only tested on windows so far.
File - New C++ Class Choose parent class - Blueprint Function Library, hit next Give it a name (for example GamepadDetection)
Then finally uncommment/enable slate module depenecies within your projectname.Build.cs and reboot you editor before hitting compile.
Now you have a node inside blueprint to check if the gamepad is connected,
answered Sep 13 '17 at 01:46 PM
If you connect to the
answered Nov 06 '18 at 07:03 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here