Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to disable xinput? #3

Open
bitinn opened this issue Dec 10, 2017 · 5 comments
Open

Is it possible to disable xinput? #3

bitinn opened this issue Dec 10, 2017 · 5 comments

Comments

@bitinn
Copy link

bitinn commented Dec 10, 2017

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
Copy link
Owner

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
Copy link
Author

bitinn commented Dec 10, 2017

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

@bitinn
Copy link
Author

bitinn commented Dec 11, 2017

@briankendall

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

Shield controller, USB connection to Windows 10

  • Controller is detected as Nvidia controller but installed as an Xbox 360 controller, using generic Microsoft drivers (Nvidia used to ship a controller driver within Nvidia card drivers, but I am no longer able to find them in newer releases...)

  • joy.cpl detects it but gives a blank Test page, and greys out the Calibrate button, unlike other controllers.

  • xboxToVJoy can detects this controller occasionally. When it does I use vjoy's own monitor to detect inputs. I have set a virtual device with 20-button, 1 POV, with ALL axes enabled just in case. I am able to detect all buttons/sticks/triggers on the Shield controller, except the Nvidia button and the Home button.

  • Steam detects Shield Controller as an Xbox One controller. Nvidia button works with Steam to bring up its own interface. Home button appears to do nothing.

Shield controller, USB connection to macOS

  • Steam detects Shield Controller as an generic gamepad, and allow layout remap. All inputs, including Nvidia button and Home button, are detectable and remappable.

  • One strange thing is these 2 buttons are detected as Button 15 and 16, so it skips a few numbers for reasons I don't understand.

Shield controller, GameStream from Shield TV to Windows 10

  • GameStream's virtual controller is not listed in Windows device manager or joy.cpl.

  • However, xboxToVJoy now detects the controller very reliably.

  • I have tested with the same vjoy virtual device, all buttons are detectable, except Nvidia button and Home button. I believe they are simply not sent via GameStream as one is binded to Shield TV Voice Search and the other is binded to Shield TV Homescreen.

  • Steam see both controllers and takes input from both as usual. Nvidia button no longer brings up Steam interface.

Shield controller, GameStream, with DLLs in place.

  • Steam Client Bootstrapper hangs indefinitely while switching into Big Picture mode. Honestly not sure what happened there.

Misc

  • What I did before your reply yesterday was to disable Steam's Base Configuration for the GameStream's controller instead, so Steam only response to vjoy device's input, which sort of works.

  • I was sacrificing my "Back" button in place for the "Guide" button. Given I am streaming to a PC, games also maps "Y" or "B" or "LT/RT" button to their back/cancel function anyway ;-)

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

@hifihedgehog
Copy link

hifihedgehog commented Jan 19, 2021

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants