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?
Look at /dev/input/by-id
and /dev/input/by-path
, or check out the output of lsinput
, or
udevadm info --query=property --name=/dev/input/eventX
Note that xinput
seems to use its own IDs which don't always correspond to /dev/input/eventX
.
install:
apt install input-utils
and issue
lsinput
this will list all your input devices along with some information about each device