code: private static int getButtonsNumber()
      {
          try
          {
              return Math.max(0, MouseInfo.getNumberOfButtons()) + 1;
          }
          catch (final HeadlessException exception)
          {
              Verbose.exception(exception);
              return DEFAULT_BUTTONS;
          }
      }
docs: Get the buttons number.
  
  @return The buttons number.