def get_tablets(display=None): # Each cursor appears as a separate xinput device; find devices that look # like Wacom tablet cursors and amalgamate them into a single tablet. cursors = [] devices = get_devices(display) for device in devices: if device.name in ('stylus', 'cursor', 'eraser') and \ len(device.axes) >= 3: cursors.append(XInputTabletCursor(device)) if cursors: return [XInputTablet(cursors)] return []
def get_tablets(display=None): # Each cursor appears as a separate xinput device; find devices that look # like Wacom tablet cursors and amalgamate them into a single tablet. valid_names = ('stylus', 'cursor', 'eraser', 'wacom', 'pen', 'pad') cursors = [] devices = get_devices(display) for device in devices: dev_name = device.name.lower().split() if any(n in dev_name for n in valid_names) and len(device.axes) >= 3: cursors.append(XInputTabletCursor(device)) if cursors: return [XInputTablet(cursors)] return []
def get_tablets(display=None): """Get list of tablets connected to display. Due to limitations, this may not be accurate. Each cursor appears as a separate xinput device; find devices that look like Wacom tablet cursors and amalgamate them into a single tablet. :param display: :return: """ cursors = list() devices = get_devices(display) for device in devices: if device.name in ("stylus", "cursor", "eraser") and len(device.axes) >= 3: cursors.append(XInputTabletCursor(device)) if cursors: return [XInputTablet(cursors)] return list()
def get_tablets(display=None): """Get list of tablets connected to display. Due to limitations, this may not be accurate. Each cursor appears as a separate xinput device; find devices that look like Wacom tablet cursors and amalgamate them into a single tablet. :param display: :return: """ cursors = list() devices = get_devices(display) for device in devices: if device.name in ('stylus', 'cursor', 'eraser') and \ len(device.axes) >= 3: cursors.append(XInputTabletCursor(device)) if cursors: return [XInputTablet(cursors)] return list()