Last active
April 4, 2024 20:50
-
-
Save ninp0/963f96ea2817bb484b36d7cb5f1c75e4 to your computer and use it in GitHub Desktop.
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 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