Skip to content

Instantly share code, notes, and snippets.

@ninp0
Last active April 4, 2024 20:50
Show Gist options
  • Save ninp0/963f96ea2817bb484b36d7cb5f1c75e4 to your computer and use it in GitHub Desktop.
Save ninp0/963f96ea2817bb484b36d7cb5f1c75e4 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import hid
# Using hid.enumerate() to get a list of all HID devices
devices = hid.enumerate()
# Loop through each device
for device in devices:
# Accessing data from a enumerated device
print("Device path: ", device['path'])
print("Vendor ID: ", device['vendor_id'])
print("Product ID: ", device['product_id'])
print("Serial Number: ", device['serial_number'])
print("Manufacturer: ", device['manufacturer_string'])
print("Product: ", device['product_string'])
print("Release Number: ", device['release_number'])
print("Interface Number: ", device['interface_number'])
print("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment