问题
I am trying to determine what /dev/input/eventX device is the touchScreen. I am currently looking at the return of EVIOCGNAME to get device name. Looking at the return values of the EVIOCGBIT ioctl I don't think there is a generic way to determine what is the touchscreen. I am interested in any sort of solution to this problem. Thanks in advance for your time!!!
回答1:
Take a look at:
- /dev/input/by-path/
- /dev/input/by-id/
- /sys/class/input/event?/device/
These might have enough info for your needs. Wish I had a touchscreen to test ;)
回答2:
If the mask returned by ioctl(EV_ABS)
contains ABS_PRESSURE
, and ioctl(EV_KEY)
contains BTN_TOOL_FINGER
, then it's probably a touchscreen.
来源:https://stackoverflow.com/questions/4795544/determining-if-a-device-is-a-touchscreen-device-in-linux