Created
January 19, 2018 21:32
-
-
Save Darkhogg/a88a3b504cbb66561fbba526ec89e030 to your computer and use it in GitHub Desktop.
Set slow and dim color cycle for G203 Mouse
This file contains hidden or 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
import usb.core | |
import usb.util | |
import binascii | |
VENDOR = 0x046d | |
PRODUCT = 0xc084 | |
INDEX = 0x0001 | |
REQUEST_TYPE = 0x21 | |
REQUEST = 0x09 | |
VALUE = 0x0210 | |
# Find the device... | |
device = usb.core.find(idVendor=VENDOR, idProduct=PRODUCT) | |
# Detach kernel module... | |
if device.is_kernel_driver_active(INDEX): | |
device.detach_kernel_driver(INDEX) | |
# Send the appropriate data... SPEED BRG | |
data = '11ff0e3c 0002 0000000000 ffff 10 000000000000'.replace(' ', '') | |
device.ctrl_transfer(REQUEST_TYPE, REQUEST, VALUE, INDEX, binascii.unhexlify(data)) | |
# Reattach kernel module... | |
usb.util.dispose_resources(device) | |
device.attach_kernel_driver(INDEX) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment