Flight stick issues with raw input

I’m implementing flight stick inputs to my flying game. I tested my flight stick (x52-pro), and Windows is receiving all inputs correctly. Unreal Engine, however, is not. Sometimes the input goes through and sometimes it doesn’t.

Here’s how to replicate:

  1. Create an event that is fired by GenericUSBControllerButton 1. Something like a Print String will do.
  2. Run the game, press that button many times.
  3. You’ll notice that the event doesn’t fire every time you press the button, and sometimes the button seems to be “stuck”.

I believe this is a bug with the engine.

Hey brunogruber-

Thank you for submitting a bug report. I have reproduced this issue and logged a report for it here Unreal Engine Issues and Bug Tracker (UE-43566) . You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.

Cheers

Hi,

I’m still seem to be getting this issue with 4.20 with a Microsoft Sidewinder joystick. Was anything done to resolve the issue or is there a work around?

Thanks

This is affecting the Dual Shock 4 as well. On Unreal Engine 4.22.3

For anyone who may be curious on how to fix this, I noticed in RawInputWindows::ParseInputData there is a DeviceButtonData.bPreviousButtonState = DeviceButtonData.bButtonState;

It looks redundant and it seems like it’s intended to be only set within SendControllerEvents whenever a button state change is processed. Button inputs were tracked accordingly when the offending line was removed.

Was anything done to resolve the issue or is there a work around?

I haven’t worked with it for a while. I did however at the time use AutoHotKey to take in the button presses and map them to key presses. Then used the key presses in UE4 and it worked flawlessly. A bit of a workaround but got me through the project I needed it for.

Thank you Alex, I have had a very frustrating day with RawInput. Mainly bc another device was ‘hiding’ my DS4 controller. I appeared to fix it at one point (I had it working with the other device plugged in) but then when I restarted the problem came back.

However your fix works like a charm for an issue I had later with unresponsive buttons! :slight_smile:

I really hope they fix the multiple device issues with RawInput but it looks like nobody is working on it at the moment.

The problem still occurs in 4.23 as well. If there is a build of this that has been corrected, I would be happy to compile it for 4.23 to at least allow me to continue testing my custom VR System Control Console before I launch my Kickstarter for it and “Apollo 11: ‘One Small Step For…’ VR Experiences.” I’d hate to spend $49-$79 for custom plug-in when this may have been corrected and just not added to the latest release.

Thanks!

Hi Alex,

I opened source ‘RawInputWindows.cpp’ for the plug-in in 4.23 and pulled few lines here for you to confirm this is the line you are speaking about under function

void FRawInputWindows::ParseInputData(const int32 InHandle, const RAWINPUT* InRawInputDataBuffer, PHIDP_PREPARSED_DATA InPreParsedData, const HIDP_CAPS& InCapabilities)

else
{
for (FButtonData& DeviceButtonData : DeviceEntry->ButtonData)
{
DeviceButtonData.bPreviousButtonState = DeviceButtonData.bButtonState;
DeviceButtonData.bButtonState = false;

}

I will remark it out and rebuild it to see if it makes difference.

It appeared that was the line and it now seems to be functioning correctly. Alex, I hope and Unreal see how easy this was to correct and makes the change in the next 4.23 update. I currently just rebuilt it in my project file.

Again thanks Alex. Saved me at least $50 on a plugin.