简体   繁体   English

如何确定bash脚本中的触摸屏设备?

[英]How can I determine touch screen device in a bash script?

I am trying out the eGalax touch screen driver for my touch screen, as an alternative to the evdev/xinput_calibrator combination. 我正在尝试为触摸屏试用eGalax触摸屏驱动程序,以替代evdev / xinput_calibrator组合。

The calibration tool that comes with the eGalax driver, TKCal, takes the device to which the touch screen is connected as a command line argument. eGalax驱动程序附带的校准工具TKCal,将与触摸屏连接的设备用作命令行参数。

Now I would like to start the calibration tool from a bash script. 现在,我想从bash脚本启动校准工具。 Is there some smart way to determine the device within the script, instead of hard coding "/dev/hidraw0" as in this example: 是否有一些聪明的方法来确定脚本中的设备,而不是像下面的示例中那样硬编码“ / dev / hidraw0”:

TKCal /dev/hidraw0 Cal TKCal / dev / hidraw0校准

I presume that I can't rely on the touch screen landing on hidraw0 every time, can I? 我假设我不能每次都依赖于落在hidraw0上的触摸屏,可以吗? If I run my software on a different system, with a mouse and a keyboard and touch screen, I guess I have to handle that the devices can be conneted to different hdrawX devices. 如果我在带有鼠标,键盘和触摸屏的不同系统上运行软件,我想我必须处理这些设备可以与不同的hdrawX设备相连的问题。 Please correct me if I am wrong. 如果我错了,请纠正我。

Thank you very much! 非常感谢你! /Fredrik Israelsson /弗雷德里克·以色列(Fredrik Israelsson)

尝试查看/sys/class/hidraw/hidraw*/device/uevent

开发eGalax驱动器的人告诉他们尝试一个更简单的解决方案:编写一个udev规则,该规则会将触摸屏映射到我选择的设备名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM