Is there a way to detect whether Ctrl or Shift has been pressed during a click event on a button or checkbox?
I want to make a checkbox that you have to hold down a modifier key in order to change the state (with appropriate visual labeling) so that it’s more difficult to accidentally click it.
You’ll want to use KeyListeners to hook the “key pressed” and “key released” events. Check out this link about key masks to determine if
shiftorctrlis pressed (or any key, for that matter).