在 Linux 中生成鼠标滚动事件
我对从 C 程序生成鼠标事件有一点疑问。我是 编写一个程序来从 Linux 中的 C 程序生成鼠标事件。我 实现了鼠标点击、拖动。 ..等使用xlib。但不知道 生成鼠标滚动事件。
操作系统:Fedora 15
I having small doubt in generating mouse event from C program. I am
writing a program to generate mouse events from a C program in linux. I
have implemented mouse click,drag. .. etc using xlib. But dont have any idea about
generating mouse scroll event.
Operating System : Fedora 15
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
X11有两种机制来报告滚动事件。老式的方法是将滚轮视为两个额外的鼠标按钮:向上滚动报告为按钮 4,向下滚动报告为按钮 5(反之亦然,我不记得了)。现代方法是通过 XInput2 扩展来报告它们,该扩展允许水平滚动和平滑滚动等。
X11 has two mechanism to report scroll events. The old-fashioned way is to treat the scroll wheel as two extra mouse buttons: scroll up is reported as button 4 and scroll down as button 5 (or vice versa, I don't remember). The modern way is to report them via the XInput2 extension, which allows things like horizontal scrolling and smooth scroll and suchlike.