如何在Java(Swing)中检测超过3个鼠标按钮?
除了常规的 3 个按钮之外,我的鼠标还有一个后退和后退按钮。前进按钮 - 如何在 Java 中检测是否按下了这两个按钮之一?
Additionally to the regular 3 buttons my mouse has a backward & forward button - how can I detect in Java if one of these two buttons is pressed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据这个< /a>,Java 7 中添加了检测除右键单击、左键单击和中键单击之外的任何鼠标按钮的功能。在所有以前的版本中,您都不能这样做。 :-(
According to this, the ability for Java to detect any mouse button other than right, left, and middle click was added in Java 7. In all previous versions, you can't. :-(
摘自此网站。由于 Swing 在底层使用 AWT,因此不要让
awt
部分打扰您。Taken from this site. Since Swing uses AWT under the hood, don't let that
awt
part bother you.