briankendall / xboxToVJoy

Translates data from XInput controllers like Xbox 360 or Xbox One controllers to a virtual DirectInput controller using VJoy
17 stars 1 forks source link

Is it possible to disable xinput? #3

Open bitinn opened 6 years ago

bitinn commented 6 years ago

Hi Brian,

I am trying to use xboxToVJoy to expose an xinput controller as directinput to Steam, so that I can enable layout remap.

While it works, I run into the problem of double input, as Steam take inputs from both my controller and vjoy controller.

So I want to hide the xinput controller from Steam, but am unsure if it's possible. Do you happen to know any solution?

(The reason I jump through these loops: I am trying to make Nvidia GameStream works better with Steam. GameStream exposes the remote controller as an Xbox controller, but the Shield controller is different from Xbox controller, so I want to expose it as a generic gamepad to allow Steam to remap buttons... More info at Nvidia forum if you want to look into it)

Many thx!

briankendall commented 6 years ago

That's a tricky problem you're trying to solve, but it turns out I'm a sucker for trying to get Windows to do things with controller input that it's normally not supposed to do (or where its design flaws prevent it from working correctly). So I can help!

I've made a proxy dll in the past that overrides the normal behavior for Xinput and prevents any app that uses it from detecting the home / guide button is being pressed. I originally made it to prevent Steam from taking over the guide button as it used to lack any sort of setting for disabling that. It's real easy to change the dll to prevent an app from being able to use Xinput at all.

Here's a link to it: https://www.dropbox.com/s/2edqhn1ixw8s3at/disable_xinput.zip?dl=0

Unzip those two dlls and put them in the same folder as Steam.exe (usually C:\Programs Files\Steam\, but it depends on where your Steam installation is.) That will prevent it from being able to read any Xinput controllers.

However, there's a number of things that may stop this from working that you should look into:

First, have you confirmed that when you map your Xinput Shield controller to vJoy using xboxToVJoy, pressing the home button is detectable? You can test this by pressing Win+R to open the "Run" dialog, enter joy.cpl, and then press OK. That should open up the Game Controllers control panel, where you can select the first vJoy device and make sure one of its buttons activates when you press the home button on your shield controller. If that works then you can move forward with this plan, but if it doesn't happen then that means that the shield doesn't translate home button presses to Xinput and you're embarking on a fool's errand! (I find it's always good to check these sorts of things before investing a lot of time in complicated solutions.)

With that out of the way, the next question is, do you need to prevent Steam and only Steam from receiving Xinput? If so, then go ahead and use that dll from the above link. However, it sounds like you'll need the games you're playing to receive Xinput input as well, in which case I'm not sure how you're going to get around the double input issue there. I'm not sure exactly how Steam translates input from a generic controller into something an ordinary game that uses Xinput can receive, but it probably uses a similar trick as overriding the Xinput dlls. It's certainly worth trying though.

Finally, be aware this may introduce some input lag, as your input is making several jumps: NVIDIA Shield -> your local network -> your gaming PC -> xboxToVJoy -> vJoy -> Steam -> the game you're actually playing. Ordinarily it just goes from your controller directly to the game.

Best of luck with this! I'll be curious to hear if you manage to get this working.

bitinn commented 6 years ago

Fabulous! I will look into your files and suggestions when I am back to my desk tomorrow.

bitinn commented 6 years ago

@briankendall

So, I have given this a shot and these are my observations:

Shield controller, USB connection to Windows 10

Shield controller, USB connection to macOS

Shield controller, GameStream from Shield TV to Windows 10

Shield controller, GameStream, with DLLs in place.

Misc

Let me know if there are other info I can provide. And if you manage to test those DLLs, do share! Thx!

hifihedgehog commented 3 years ago

Was informed that HidGuardian is EOL-ed and HidHide is perhaps a couple months away from its first public release. See here and here for ViGEm team's @nefarius's posts alluding to an imminent release. HidHide will be replacing HidGuardian and--most notably--will be adding support for hiding XInput controllers.

briankendall commented 3 years ago

Good tip! I've got some cases where hiding XInput controllers is needed. I'm also curious about HIDHide and the techniques it uses, as it may very well be a superior method to the DLL overriding method I'm using with devreorder.