Bridges a generic USB controller to a virtual input that behaves like a standard Xbox 360 Controller.
This is only for Linux.
Mostly vibecoded for fun and experimentation, the numbers are hardcoded to controllers I have access to so you may need to modify them in the code to make it work for your controller.
go run main.go -grab /dev/input/event18- Replace
/dev/input/event18with the event number that corresponds to your controller. -grabwill useEVIOCGRABto get exclusive access to the physical controller, meaning other programs won't receive inputs from it, use it if you face duplicate input problems. This doesn't completely hide the controller, programs may still detect the original controller.- You may have to edit
main.goand replace thephysicalXXXconstants with the correct numbers for your controller, runevtestto find them.
- Opens the
/dev/input/eventXfile and readsinputEvents from it. - Uses
uinputthroughioctlsyscalls to create a virtual input and mimics the Xbox 360 vendor/product IDs. - Forwards the
inputEvents from the physical controller to the virtual input after translation. - If
-grabis passed, grab the physical controller withEVIOCGRAB - Rumble is currently not implemented
0 comments
log in to comment.