[Feature Request] Gamepad bIsConnected

Hello, following this old post, I have tried to implement the code to detect whether gamepad is connected.

virtual bool IsGamepadConnected() { return false; }
virtual bool IsGamepadConnected() override;

bool FWindowsApplication::IsGamepadConnected()
         return XInput->IsGamepadConnected();

bool IsGamepadConnected();

bool XInputInterface::IsGamepadConnected()
         for (int32 ControllerIndex = 0; ControllerIndex < MAX_NUM_XINPUT_CONTROLLERS; ++ControllerIndex)
             FControllerState& ControllerState = ControllerStates[ControllerIndex];
             if (ControllerState.bIsConnected)
                 return true;
         return false;

TSharedPtr<GenericApplication> GenericApplication =  SlateApplication::Get().GetPlatformApplication();

The function “GenericApplication->IsGamepadConnected()” returns “true” in the editor (PIE), but in a “package build” or a “Standalone Game” returns “false” (Windows). Anyone know why?

Another problem is that “ControllerStates[MAX_NUM_XINPUT_CONTROLLERS]” is private, and to implement it I must to do on the Source version. This is a problem because all computers on our team have Binary version installed.
It would be possible to add a “getter” (accessor method) to access the attribute in a new fix of the engine?

If this is not possible, any workaround?

Thx a lot :wink:

any workaround?

Possible solution here, have a look.

link text