# MageDok 7" Touchscreen USB Device Rules
# Ensure touch device is recognized and accessible

# Generic USB touch input device (MageDok)
# Manufacturer typically reports as: EETI eGTouch Controller
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="*eGTouch*", TAG="uaccess"
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="*EETI*", TAG="uaccess"
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="*MageDok*", TAG="uaccess"

# Fallback: Any USB device with touch capability (VID/PID may vary by batch)
SUBSYSTEM=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceSubClass}=="01", TAG="uaccess"

# Create /dev/magedok-touch symlink for consistent reference
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="*eGTouch*", SYMLINK="magedok-touch"
SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="*EETI*", SYMLINK="magedok-touch"

# Permissions: 0666 (rw for all users)
SUBSYSTEM=="input", KERNEL=="event*", MODE="0666"
SUBSYSTEM=="input", KERNEL=="mouse*", MODE="0666"
