Last active
October 3, 2024 21:43
-
-
Save dnmodder/de2df973323b7c6acf45f40dc66e8db3 to your computer and use it in GitHub Desktop.
This script should no longer be necessary thanks to the latest changes made to the master branch of the xpad [https://github.com/paroj/xpad] driver, please give it a try and report any regressions you find.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
try: | |
import usb.core | |
import usb.util | |
except ImportError: | |
print("First, install the pyusb module with PIP or your package manager.") | |
else: | |
if os.geteuid() != 0: | |
print("You need to run this script with sudo") | |
sys.exit() | |
dev = usb.core.find(find_all=True) | |
for d in dev: | |
if d.idVendor == 0x045e and d.idProduct == 0x028e: | |
d.ctrl_transfer(0xc1, 0x01, 0x0100, 0x00, 0x14) | |
finally: | |
sys.exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i have a fake ps3 controller that doesn't work even with these scripts i need help
dmesg :
[ 3224.411687] sony 0003:054C:0268.0010: input,hiddev97,hidraw2: USB HID v81.10 Joystick [Nintendo Co., Ltd. USB Gamepad] on usb-0000:00:14.0-1/input0
lsusb :
Bus 003 Device 012: ID 045e:028e Microsoft Corp. Xbox360 Controller
journalctl -f :