我该如何将 Ctrl+Click 包含为右键单击? (爪哇)
我有一个右键单击的选项。但是需要使用Ctrl + Click
的用户无法使用右键单击,因为Java只允许点击右键按钮。
有谁知道如何允许 Ctrl + Click
以及右键单击按钮?
谢谢!
I have an option to right-click. But users that need to use Ctrl + Click
cannot use right-click because Java only allows for the right-click button to be hit.
Does anyone know how I can allow for Ctrl + Click
, as well as the right-click button?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您希望通过一键鼠标支持 Mac 上的用户。这是解决此问题的另一个问题:如何检测右键单击Mac OS 的事件
查看未接受的答案,因为这似乎是最佳解决方案。长话短说,您想要使用
SwingUtilities.isRightMouseButton(event)
。I'm assuming that you want to support users on Macs with one button mice. Here's another question that addressed this issue: How to detect right-click event for Mac OS
Check out the answer that wasn't accepted as that appears to be the best solution. Long story short, you want to use
SwingUtilities.isRightMouseButton(event)
.