in evdev i'm trying to check to see if there is a mouse and keyboard plugged in and if so assign the device path to a variable to be used. This worked for a while as i just checked for the name Mouse or Keyboard in the device name by using this code
if ("KEYBOARD" in device.name) or ("Keyboard" in device.name):
print ("This is a Keyboard")
keyboarddir = device.path
keyboard = evdev.InputDevice(keyboarddir)
After plugging in a different mouse i discovered that they don't all say mouse in there and i wanted to know if there was a way i could compare a string called "BTN_RIGHT" to the device capabilities. The code i typed which doesn't work would go something like this.
if ("BTN_RIGHT" in device.capabilities(verbose=True)):
print ("this is the mouse")
Please help me figure out how to detect a mouse easier or by actually being able to search through its capabilities and compare them to other strings!