private static boolean hasJPopupMenu(MenuElement[] path) {
		if (path == null || path.length == 0) {
			return false; // no menu showing
		}

		// Checking for the exact class seems to be good enough for now.  We can update later if
		// we find this filters out too many use cases. At the time of writing, we do not want this
		// code to apply to all popup windows, such as combo box popups.
		for (MenuElement element : path) {
			if (element.getClass().equals(JPopupMenu.class)) {
				return true;
			}
		}
		return false;
	}
Checks the given event to see if it has a registered action to perform while a menu is open.
If a menu is open and a handler exists, the handler will be called.

@param event the event to check
@return true if the event triggered a handler
Ghidra/Framework/Docking/src/main/java/docking/menu/keys/MenuKeyProcessor.java