在 Linux 中向鼠标驱动程序提供备用数据

发布于 2024-08-23 10:22:55 字数 205 浏览 2 评论 0原文

我无法理解如何将替代数据输入鼠标驱动程序以在不移动鼠标的情况下控制指针。

我修改了一个驱动程序(未经测试)来提供随机数据,但我需要能够打开/关闭随机鼠标数据,并且我不认为简单的 scanf 会询问“你想这样做吗?”即将开始工作。我认为我需要构建某种与驱动程序交互的界面。

有人可以给我对此的任何看法吗?我不太清楚我需要做什么。

谢谢, 肖恩·刘易斯

I'm in way over my head and looking for a broader understanding of what it would take to feed alternate data into a mouse driver to control the pointer without moving the mouse.

I have modified a driver (untested) to provide random data, but I need to be able to turn on/off the random mouse data and I don't think a simple scanf to ask for a "Do you want to do this?" is going to work. I think that I need to build an interface of some kind that will interact with the driver.

Can anybody give me any perspective on this? I have very little idea of what I need to do.

Thanks,
Shawn Lewis

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

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

评论(4

祁梦 2024-08-30 10:22:55

这取决于您修改的鼠标驱动程序位于用户空间还是内核空间。

如果是用户空间,您可以使用 UNIX 域套接字作为控制通道。如果是内核空间,您可以使用 sysfs 条目。

That depends on if the mouse driver you've modified is in userspace or kernelspace.

If it's userspace, you could use a UNIX-domain socket as your control channel. If it's kernelspace, you could use a sysfs entry.

栀梦 2024-08-30 10:22:55

也许您可以从设备读取真实数据,但发送随机垃圾。当您读取点击或某些动作时,您可以切换到实模式。如果在一段时间内没有任何动作,您可以再次切换到随机。这完全取决于您想要实现什么目标。

Probably you can read real data from device but send random junk. When you read a click or some movement you can switch to real mode. If no movement in some timeout you can switch to random again. It all depends what are you trying to accomplish.

迷鸟归林 2024-08-30 10:22:55

uinput 可用于注入输入事件。

uinput can be used to inject input events.

别忘他 2024-08-30 10:22:55

关于已经提到的uinput的优秀教程:http://thiemonge.org/ uinput 入门

An excellent tutorial about already mentioned uinput: http://thiemonge.org/getting-started-with-uinput

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