aj1
aj1

Reputation: 23

How to prevent Xbox controller input in uwp app

I have created a UWP application that polls an Xbox Controller and does various tasks with the user input. I have a problem whereby the controller is able to interact with, and control the UI. I have played around with IsFocusEngagementEnabled which does almost what I want, but not quite. With this enabled, the control of the UI is prevented (even if I have to add the control to every user accessible control), however, the use of the select key, as documented, then allows interaction with the UI. Is there a away to completely disable UI/application interaction, except for where I explicitly use the Gamepad class?

Thanks

Upvotes: 0

Views: 407

Answers (1)

vectorjon
vectorjon

Reputation: 51

This is a solution that involves rolling back the Xinput driver to an older one that does not support UWP.

1. Download the cab file "Microsoft - Game Devices, Other hardware - XBOX 360 Controller For Windows" Last Updated "8/12/2009" Size "2.5 MB" from: https://www.catalog.update.microsoft.com/Search.aspx?q=%20Microsoft%20-%20Game%20Devices%2C%20Other%20hardware%20-%20XBOX%20360%20Controller%20For%20Windows%20

2. Use 7-Zip to extract the cab file. This will result in a folder that contains:

  • two folders "x64" & "x86"
  • and three files: "INF Failures.txt", "xusb21.cat", & "xusb21.inf".

Open "control panel" and search for and navigate to "device manager".

4. In "device manager", if you have an Xinput controller plugged in, when you scroll down you will eventually see "Xbox 360 Perphearals". Click it.

5. Right click on "Xbox 360 Controller for Windows" and select "Update Driver Software".

6. Click on "Browse my computer for driver software".

7. Click on "Let me pick from a list of device drivers on my computer".

8. Click on "Have Disk..." in the lower right corner of the window.

9. Click on "Browse..." and navigate into the extracted folder from earlier that contains the driver.

10. Select the "xusb21.inf" file then click "Open".

11. Click "OK".

12. Click "Next" then the driver should install.

13. You will be asked to "restart your computer". Do it when you are ready so that the changes will go into effect.

14. You should be all set. Hopefully this will work for you.

Upvotes: 0

Related Questions