Using a hotkey to toggle a USB input device

2

I'm looking for a way to enable and disable an Xbox 360 controller which is connected via USB using a custom hotkey.

RolandPeterson

Posted 2015-11-27T01:17:55.270

Reputation: 21

If it was me, I would make a batch script to execute this in a toggle fashion, then setup an AHK program to run the script on hotkey press. This isn't an "easy task" to say the least.

– Insane – 2015-11-27T01:52:20.867

With having close to no experience with batch files, I'm thinking that this might be feasible for me to delve into. However, is there any risk in trying to tinker with this? – RolandPeterson – 2015-11-27T02:37:07.697

I don't really see any major risks trying. The last time I setup a detailed guide from scratch for someone on how to do something like this it got little response so I'm hesitant to do it again :P

– Insane – 2015-11-27T02:38:51.533

Oh man. Something like that would be awesome though. Especially because the link to Devcon.exe doesn't exist anymore, and now I'm trying to find it elsewhere on microsofts website. – RolandPeterson – 2015-11-27T02:48:50.547

Answers

0

This can be done with a Batch file, and DEVCON (program for working with USB).

  1. Download DEVCON
  2. Enter the following code in a batch file
 @echo off
SET usbDeviceName = " "
IF counter = 1 (
     start /w devcon disable %usbDeviceName%
     SET counter = 0
) ELSE (
     start /w devcon enable %usbDeviceName%
     SET counter = 1
) 

Michelfrancis Bustillos

Posted 2015-11-27T01:17:55.270

Reputation: 121