0

I'm going to read the stream from touchpad, I know I can do it through /dev/input/eventX, but how can I determine which one represents the touchpad and which one represents the keypad?Thank you!

asked Sep 6, 2013 at 11:58

2 Answers 2

2

This is how I find the touchpad: look for the list of the id's of all devices.

xinput --list

Find the id of the touchpad. For example, my touchpad is in id=12 then

xinput --list-props 12 | grep "Device Node"

and it should show you the /dev/input/event* that you are looking for.

answered Jul 17, 2018 at 10:19
Sign up to request clarification or add additional context in comments.

Comments

1

Use ioctl on the entries in /dev/input. The various functions seem to be sporadically implemented, but code=ioctl(fd, EVIOCGNAME(sizeof(buf)), buf); will give you a name at least.

Actually, only root can do iotctl on /dev. It's better to enumerate /sys/class/input and get the name entries.

answered Sep 26, 2013 at 13:58

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.