2

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!

2
  • I currently use something like InputButton == InputEvent 3 or something. IDK I can't remember, hold on a sec. Commented Sep 1, 2011 at 0:37
  • I currently use InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK to determine a right click. Commented Sep 1, 2011 at 0:39

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.