private boolean processKeyEventOnWindows( KeyEvent e ) {
		if( e.getKeyCode() != KeyEvent.VK_ALT ) {
			selectMenuOnAltReleased = false;
			return false;
		}

		if( e.getID() == KeyEvent.KEY_PRESSED ) {
			altPressedEventCount++;

			if( altPressedEventCount == 1 && !e.isConsumed() ) {
				MenuSelectionManager menuSelectionManager = MenuSelectionManager.defaultManager();
				selectMenuOnAltReleased = (menuSelectionManager.getSelectedPath().length == 0);

				// if menu is selected when Alt key is pressed then clear menu selection
				if( !selectMenuOnAltReleased )
					menuSelectionManager.clearSelectedPath();
			}

			// show mnemonics
			showMnemonics( shouldShowMnemonics( e ), e.getComponent() );

			// avoid that the system menu of the window gets focus
			e.consume();
			return true;

		} else if( e.getID() == KeyEvent.KEY_RELEASED ) {
			altPressedEventCount = 0;

			boolean mnemonicsShown = false;
			if( selectMenuOnAltReleased && !e.isConsumed() ) {
				MenuSelectionManager menuSelectionManager = MenuSelectionManager.defaultManager();
				if( menuSelectionManager.getSelectedPath().length == 0 ) {
					// get menu bar and first menu
					Component c = e.getComponent();
					JRootPane rootPane = SwingUtilities.getRootPane( c );
					JMenuBar menuBar = (rootPane != null) ? rootPane.getJMenuBar() : null;
					if( menuBar == null ) {
						// get menu bar from frame/dialog because there
						// may be multiple nested root panes in a frame/dialog
						// (e.g. each internal frame has its own root pane)
						Window window = SwingUtilities.getWindowAncestor( c );
						if( window instanceof JFrame )
							menuBar = ((JFrame)window).getJMenuBar();
						else if( window instanceof JDialog )
							menuBar = ((JDialog)window).getJMenuBar();
					}
					JMenu firstMenu = (menuBar != null) ? menuBar.getMenu( 0 ) : null;

					// select first menu and show mnemonics
					if( firstMenu != null ) {
						menuSelectionManager.setSelectedPath( new MenuElement[] { menuBar, firstMenu } );
						showMnemonics( true, c );
						mnemonicsShown = true;
					}
				}
			}
			selectMenuOnAltReleased = false;

			// hide mnemonics
			if( !mnemonicsShown )
				showMnemonics( shouldShowMnemonics( e ), e.getComponent() );
		}
		return false;
	}
Special Alt key behavior on Windows.

Press-and-release Alt key selects first menu (if available) and moves focus
temporary to menu bar. If menu bar has focus (some menu is selected),
pressing Alt key unselects menu and moves focus back to permanent focus owner.
flatlaf-core/src/main/java/com/formdev/flatlaf/MnemonicHandler.java