Dylan Wheeler
Dylan Wheeler

Reputation: 7074

How would I go about including Ctrl+Click as a right-click? (Java)

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!

Upvotes: 2

Views: 1350

Answers (1)

Jon7
Jon7

Reputation: 7215

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).

Upvotes: 3

Related Questions