#✅ | close menu
1 messages · Page 1 of 1 (latest)
Hi Shadoww! 👋
You're looking to stop a menu from closing when you press the Escape key, right? FancyMenu doesn't have a direct setting to prevent the Escape key from closing menus. Minecraft handles the Escape key functionality by default.
However, you might be able to achieve something similar using a Listener. You could potentially set up an "On Keyboard Key Pressed" listener that checks for the Escape key and then, instead of letting the menu close, it could perhaps open a different menu or perform another action. This wouldn't prevent the current menu from closing, but it could immediately open a new screen in response to the Escape key press.
You can find more information about Listeners here: Listeners
Keep in mind that this approach is more of a workaround, as the Escape key's default behavior is deeply ingrained in Minecraft.
Is it possible to make it so that when it detects that the menu is closing, it cancels the action?
That's a great question, Shadoww! 🤔 Unfortunately, FancyMenu doesn't have a direct "cancel" feature for preventing a screen from closing once it's detected as closing. Once the On Screen Closed listener triggers, the screen is already in the process of closing, and there's no built-in action to halt that process.
The On Screen Closed listener is more for reacting after a screen has closed, rather than preventing it from closing.
So, for the Escape key scenario, the method I mentioned earlier (using the "On Keyboard Key Pressed" listener to immediately open another screen) would be the closest workaround.
Let me know if you have any other ideas or questions! 😊
This support thread has been automatically marked as solved because there were no new messages for at least 24 hours.
If you still need help, feel free to continue the conversation or create a new support thread.