As the state of docs, BUTTON1_MASK and BUTTON1_DOWN_MASK are modifier constants, that is, they are used in conjunction with MouseEvent#getModifiers . They are not expanded, but are used as mask values, for example
@Override public void mousePressed(MouseEvent me) { if ((me.getModifiers() & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) { System.out.println("Left button pressed."); } }
BUTTON1_DOWN_MASK used to determine the state of the mouse button, while BUTTON1_MASK simply helps determine which button is pressed.
Reimeus
source share