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.