如何在 bash 脚本中确定触摸屏设备?
我正在尝试为我的触摸屏使用 eGalax 触摸屏驱动程序,作为 evdev/xinput_calibrator 组合的替代方案。
eGalax 驱动程序附带的校准工具 TKCal 将触摸屏连接的设备作为命令行参数。
现在我想从 bash 脚本启动校准工具。是否有一些聪明的方法来确定脚本中的设备,而不是硬编码“/dev/hidraw0”,如本例所示:
TKCal /dev/hidraw0 Cal
我想我不能每次都依赖触摸屏登陆 hidraw0时间,我可以吗?如果我在不同的系统上运行我的软件,使用鼠标、键盘和触摸屏,我想我必须处理这些设备可以连接到不同的 hdrawX 设备。如果我错了,请纠正我。
非常感谢! /弗雷德里克·伊斯雷尔森
I am trying out the eGalax touch screen driver for my touch screen, as an alternative to the evdev/xinput_calibrator combination.
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.
Now I would like to start the calibration tool from a bash script. Is there some smart way to determine the device within the script, instead of hard coding "/dev/hidraw0" as in this example:
TKCal /dev/hidraw0 Cal
I presume that I can't rely on the touch screen landing on hidraw0 every time, can I? 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. Please correct me if I am wrong.
Thank you very much!
/Fredrik Israelsson
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试查看
/sys/class/hidraw/hidraw*/device/uevent
。Try looking at
/sys/class/hidraw/hidraw*/device/uevent
.开发 eGalax 驱动器的人被告知要尝试一个更简单的解决方案:
编写一个 udev 规则,将触摸屏映射到我选择的设备名称。
The guys developing the eGalax drive told be to try a much simpler solution:
Write a udev rule that will map the touch screen to a device name of my choice.