I am playing with enhanced inputs, but one thing is clear - “enhanced inputs” is a big misnomer! There are really many problems, which you think should not exist in an “enhanced approach”, but they do.
Anyway, my current problem is that Unreal Engine (5.3.2) is getting inputs from the Generic USB Controller Axes, even though the controller is not connected. I know the inputs are being fired, because I am using “showdebug enhancedinputs” to see this. Moreover, I know that the problem are the generic USB controller axes, because if I remove them from my mapping context, the problem goes away.
So, Unreal Engine is taking inputs from somewhere else, but from where, if there’s no controller connected?
What’s the recommended way to solve this?
Clearly, people might want to support different controllers (so I cannot just disable RawInput, because it’s the only official way to do this). We cannot just say, let’s not support it because we have this issue that Unreal Engine is not clever enough to understand that there’s nothing connected. Maybe there’s something I missed that would stop these generic usb controller from firing when there’s nothing connected. I’ve heard of the term “phantom controller”. Clearly, nobody wants their game to get inputs from a ghost. Nothing is more irritating than not being able to control something and not knowing what is controlling it.
Sounds like something like a flight stick device if it would pop up on my hardware list.
Nothing connected on USB? No virtual devices running? No background services running to provide gamepad compatibility (like non official gamepad drivers)?
If the above does not apply, see if you can get an ID that you can match to your Device Manager (windows), look under Human Interface Devices, or Serial Bus Controllers, Game Controllers, and other relevant categories there. Most likely something there is installed by the same name.
I’m using an XBox controller. I didn’t install any compatibility software, as far as I remember. I only installed the usual software, like XBox Accessories. Anyway, for the XBox controller, I’m not using the RawInput. Just regular gamepad bindings. I’m using the RawInput for another device.
I suspect that the RawPlugin or Unreal Engine is not properly forgetting the device or handling the case when there’s no device. I know that the RawPlugin or the enhanced inputs will not work properly if you reconnect the device and don’t restart Unreal Engine. In fact, if I do that, RawInput’s registered device is still returning the name of my device, but I can’t control anymore the pawn with the device. I need to restart UE. This may not be related, but it could.
Anyway, when you say to search for the ID, I am not sure which ID you’re referring to. There’s a node called “Get All Connected Input Devices”, but the ID of the device is always 0 for some reason, which seems to be useless. Moreover, Unreal Engine always reports just 1 device. If I connect only my XBox controller, it shows that I have 1 device which has an ID = 0. If I connect my custom controller, it still shows that I have only 1 device. If I start UE with both connected, then disconnect the XBox controller, it shows that I have no more device, which would suggests that this function/node ignores the RawInput devices. However, if I disconnect the XBox controller and leave only my custom device and restart UE, it shows that I have only 1 device. It’s difficult to reason about anything when things don’t make much sense.
This is true. One of many reasons I still don’t use Enhanced Input for it’s both experimental and not an improvement over the old system. Can’t tell if it’s an enhanced input bug.
Replying to that previous post I was thinking that maybe you could identify where the input is coming from by hardware ID / driver, if something you can retrieve from Unreal would match what you can find in the OS. because something like “Generic USB Controller Axes” is generally a device you’d find in the Device Manager of Windows. It’s always possible a driver is messing up.
Any way to detect what buttons / axes enhanced input is firing? Like, if it’s a joystick axis, would setting a deadzone for minimal input stop it to fire?
They were axes. I had set a deadzone to 0.5 to the inputs that were firing below that threshold and indeed it stopped them, but I couldn’t find the info where these inputs are being fired from. I just know they come from the generic USB axes, but is unclear to me what device or thing was triggering those axes. In any case, one cannot just use bigger deadzone to fix this issue as this affects how much you have to press or whatever those axes for them to start doing anything when the device is connected.
I agree, I suggested it for testing. A working deadzone means there is actually a constant stream of float values being read / generated somewhere. That is the odd part. (I mean, even stranger than just a phantom device, because there are numbers on the input instead of 0s). Question is how to identify where it’s coming from. Are you familiar with visual studio? you could attach its debug mode to Unreal Engine and set breakpoints where Enhanced Input registers the axes input, then see if you can figure out where it comes from through the call stack.