print("Using {}: {}\n".format(self.name, self.path))
if not self.has(libevdev.EV_ABS.ABS_MT_TOUCH_MAJOR):
- raise InvalidDeviceError("device does not have ABS_MT_TOUCH_MAJOR")
+ raise InvalidDeviceError("Device does not have ABS_MT_TOUCH_MAJOR")
self.has_minor = self.has(libevdev.EV_ABS.ABS_MT_TOUCH_MINOR)
self.has_orientation = self.has(libevdev.EV_ABS.ABS_MT_ORIENTATION)
except (PermissionError, OSError):
print("Error: failed to open device")
except InvalidDeviceError as e:
- print("Error: {}".format(e))
+ print("This device does not have the capabilities for size-based touch detection.");
+ print("Details: {}".format(e))
if __name__ == "__main__":
absinfo = self.absinfo[libevdev.EV_ABS.ABS_PRESSURE]
self.has_mt_pressure = False
if absinfo is None:
- raise InvalidDeviceError("device does not have ABS_PRESSURE/ABS_MT_PRESSURE")
+ raise InvalidDeviceError("Device does not have ABS_PRESSURE or ABS_MT_PRESSURE")
prange = absinfo.maximum - absinfo.minimum
except (PermissionError, OSError):
print("Error: failed to open device")
except InvalidDeviceError as e:
- print("Error: {}".format(e))
+ print("This device does not have the capabilities for pressure-based touch detection.");
+ print("Details: {}".format(e))
if __name__ == "__main__":