You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
324 B
Python

import libevdev
import sys
device_path = sys.argv[1]
with open(device_path, 'rb') as f:
d = libevdev.Device(f)
print(f"Device: {d.name}")
print("Capabilities:")
for event_type, codes in d.capabilities().items():
print(f" {event_type}:")
for code in codes:
print(f" {code}")