I have a raspberry pi3 and one 7" official lcd and have code to get data from touch input, but when I plug a keyboard into the RPI the touch device is event2, and event0 when keyboard is unplugged. So how do I determine which event is represent for touch?
/dev/input/by-path, or check out the output of
udevadm info --query=property --name=/dev/input/eventX
xinput seems to use its own IDs which don't always correspond to
apt install input-utils
this will list all your input devices along with some information about each device