Lines Matching refs:device
94 for device in context.list_devices(subsystem="input"):
95 if not device.get("ID_INPUT_TOUCHPAD", 0):
98 if not device.device_node or not device.device_node.startswith(
103 return device.device_node
105 print("Unable to find a touch device.", file=sys.stderr)
150 Returns a tuple of (xfuzz, yfuzz) with the fuzz as set on the device
154 raise InvalidDeviceError("device does not have x/y axes")
159 raise InvalidDeviceError("device does not have both multitouch axes")
186 def handle_existing_entry(device, fuzz):
196 0x00: device.udev_device.get("EVDEV_ABS_00"),
197 0x01: device.udev_device.get("EVDEV_ABS_01"),
198 0x35: device.udev_device.get("EVDEV_ABS_35"),
199 0x36: device.udev_device.get("EVDEV_ABS_36"),
211 print("This device already has axis overrides defined")
242 "The device has a hwdb override defined but it's not where I expected it to be."
248 print_bold("Probable entry for this device found in line {}:".format(lineno))
252 print_bold("Suggested new entry for this device:")
264 # risky. And it may not be our device match anyway.
269 "1. Check the above suggestion for sanity. Does it match your device?",
291 if test_hwdb_entry(device, fuzz):
306 def reload_and_trigger_udev(device):
311 syspath = device.path.replace("/dev/input/", "/sys/class/input/")
318 def test_hwdb_entry(device, fuzz):
319 reload_and_trigger_udev(device)
322 d = Device(device.path)
328 "The hwdb applied to the device but libinput's udev "
374 def write_udev_rule(device, fuzz):
375 """Write out a udev rule that may match the device, run udevadm trigger and
406 svn[3:], device.name, device.name, svn, pvr, fuzz, fuzz, fuzz, fuzz
409 svn[3:], device.name, device.name, svn, pn, fuzz, fuzz, fuzz, fuzz
427 if handle_existing_entry(device, fuzz):
455 if test_hwdb_entry(device, fuzz):
463 print("The hwdb entry failed to apply to the device.")
466 reload_and_trigger_udev(device)
485 help="Path to device (optional)",
491 device = Device(args.path)
492 print_bold("Using {}: {}".format(device.name, device.path))
494 fuzz = device.check_property()
497 fuzz = device.check_axes()
502 write_udev_rule(device, userfuzz)