开发者

Determining if a device is a touchscreen device in linux

开发者 https://www.devze.com 2023-02-06 10:51 出处:网络
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 theEVIOCGBIT ioctl I don

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消