Determining if a device is a touchscreen device in linux

こ雲淡風輕ζ 提交于 2019-12-25 03:13:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!