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

发布于 2024-12-07 21:30:00 字数 368 浏览 0 评论 0原文

我正在尝试为我的触摸屏使用 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橘虞初梦 2024-12-14 21:30:00

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

Try looking at /sys/class/hidraw/hidraw*/device/uevent.

金橙橙 2024-12-14 21:30:00

开发 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文