Lines Matching refs:device
110 def __init__(self, device, tracking_id):
111 self.device = device
131 if touch.pressure < self.device.up:
133 elif touch.pressure > self.device.down:
137 self.is_palm = touch.pressure > self.device.palm
141 self.is_thumb = touch.pressure > self.device.thumb
247 for device in context.list_devices(subsystem="input"):
248 if not device.get("ID_INPUT_TOUCHPAD", 0):
251 if not device.device_node or not device.device_node.startswith(
256 return device.device_node
257 print("Unable to find a touchpad device.", file=sys.stderr)
288 def handle_key(device, event):
302 def handle_abs(device, event):
305 device.start_new_sequence(event.value)
308 s = device.current_sequence()
315 event.matches(libevdev.EV_ABS.ABS_PRESSURE) and not device.has_mt_pressure
318 s = device.current_sequence()
326 def handle_event(device, event):
328 handle_abs(device, event)
330 handle_key(device, event)
333 def loop(device):
353 print(fmt.values(["Thresh", device.down, device.up, device.palm, device.thumb]))
359 for event in device.events():
360 handle_event(device, event)
383 help="Path to device (optional)",
406 device = Device(args.path)
409 device.down, device.up = args.touch_thresholds
412 device.palm = args.palm_threshold
415 device.thumb = args.thumb_threshold
417 loop(device)
423 print("Error: failed to open device")
426 "This device does not have the capabilities for pressure-based touch detection."