在Linux中确定设备是否为触摸屏设备 [英] Determining if a device is a touchscreen device in linux

查看:279
本文介绍了在Linux中确定设备是否为触摸屏设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试确定/ dev / input / eventX设备是触摸屏。我目前正在查看EVIOCGNAME的返回以获取设备名称。查看EVIOCGBIT ioctl的返回值,我认为没有通用的方法可以确定什么是触摸屏。我对这种问题的任何解决方案都感兴趣。在此先感谢您的时间!!!

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!!!

推荐答案

如果 ioctl(EV_ABS)返回的掩码包含 ABS_PRESSURE ioctl(EV_KEY)包含 BTN_TOOL_FINGER ,则可能触摸屏。

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.

这篇关于在Linux中确定设备是否为触摸屏设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆