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 i开发者_如何学JAVAs the touchscreen. I am interested in any sort of solution to this problem. Thanks in advance for your time!!!
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 ;)
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.
精彩评论