简体   繁体   English

是否可以使用java.awt.Robot进行水平mouseWheel滚动?

[英]Is it possible to do horizontal mouseWheel scrolling with java.awt.Robot?

I can use mouseWheel() from java.awt.Robot to simulate a vertical mouse wheel scroll. 我可以使用java.awt.Robot中的mouseWheel()来模拟垂直鼠标滚轮滚动。 On OS XI have a Mighty Mouse that will scroll horizontally too. 在OS XI上,有一个强大的鼠标,它也会水平滚动。 Is there any way I can simulate this with java.awt.Robot? 有什么办法可以用java.awt.Robot模拟吗? The documentation only shows vertical scrolling. 文档仅显示垂直滚动。

Not according to that framework. 不是根据那个框架。

But an alternative to this, and keep in mine I haven't done this in your environment, is if you are able to generalize the keystroke of the left and right scroll. 但这是一种替代方法,请记住,在您的环境中我尚未执行此操作,是您是否能够概括左右滚动的按键。 You can essentially issue you application to move right and left. 实际上,您可以发出应用程序以左右移动。 You can implement a keylistener that does that tick. 您可以实现一个执行此操作的按键侦听器。 This is how I have done a few of these for web application using JS. 这就是我使用JS为Web应用程序完成的一些方法。

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

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