public void mouseButtonEvent(MouseEvent event) {
    if (event.isConsumed())
      return;

    int m = event.getModifiersEx() & MODIFIER_MASK;

    if (event.getButton() == MouseEvent.BUTTON2)
      m &= ~MouseEvent.ALT_DOWN_MASK;

    if (event.getButton() == MouseEvent.BUTTON3)
      m &= ~MouseEvent.META_DOWN_MASK;

    if (event.getID() == eventId && event.getButton() == button && m == keyMask) {
      DockingWindow window = (DockingWindow) event.getSource();
      action.perform(window);

      if (consumeEvent)
        event.consume();
    }
  }