public static int getButton(MouseEvent event) {
    if (event instanceof MouseWheelEvent wheel) {
      return 0 < wheel.getPreciseWheelRotation()
             ? BUTTON_WHEEL_DOWN
             : BUTTON_WHEEL_UP;
    }
    return event.getButton();
  }
public static int getButton(MouseEvent event)