#✅ | Making navigation easier with keyboard
1 messages · Page 1 of 1 (latest)
I’m checking how FancyMenu handles keyboard navigation for menu buttons. I’ll see if there’s a built-in way to bind a key like 1 to a button, or if it needs a workaround 🙂
Yep, you can do that in FancyMenu 😄
The basic idea is:
- Create a listener for keyboard input
- Check if the pressed key is
1 - Trigger a fake click on the Singleplayer button
What to do:
- Open the menu bar
- Go to
Customization→Manage Listeners - Create a listener like On Keyboard Key Pressed
- Add an
IFcondition that checks the pressed key, using the listener variable$$key_name - If it is
1, run the action Mimic Vanilla/Mod Button
For the button target, you need the title screen’s screen identifier and the button locator for Singleplayer. The easiest way is:
- Open the Title Screen
- Enable FancyMenu’s Debug Overlay
- Use that info to get the screen identifier
- Then set the mimic action to that title screen button
So in short:
- Listener: keyboard key press
- Condition: key is
1 - Action: mimic the Singleplayer button on the title screen
If you want, I can help you build the exact listener script step by step and show you where to find the button ID in the debug overlay 🙂
Wouldn't this happen if I was in a world (In-game)?
Good catch, I’m double-checking whether that key listener also fires while you’re actually in a world, so I can tell you the safe setup 🙂
Yes, exactly 😅
That listener would also fire in-game unless you restrict it to the main menu.
So the safe setup is:
- Listener:
On Keyboard Key Pressed - Condition 1: current screen is the Title Screen
- Condition 2: pressed key is
1 - Action: mimic the Singleplayer button
In FancyMenu terms, the cleanest guard is to check the current screen identifier and only run it when it matches the title screen, so it won’t trigger while you’re inside a world.
So the result is:
- on main menu + press
1→ opens Singleplayer - in a world + press
1→ does nothing
If you want, I can help you write the exact IF setup in FancyMenu step by step 🙂
How can I do both conditions?
I’m checking the cleanest way to combine the screen check and the 1 key check in FancyMenu, so I don’t give you the wrong setup 🙂
Use nested IFs 🙂 That’s the easiest way to combine both conditions in FancyMenu.
Do it like this:
IF screen is title_screen
IF key name is 1
Mimic Vanilla/Mod Button
In the listener:
- Create an On Keyboard Key Pressed listener
- Add an IF that checks the current screen is the Title Screen
- usually by checking
screenid
- usually by checking
- Inside that IF, add another IF that checks
$$key_nameis1 - Inside the second IF, add Mimic Vanilla/Mod Button for the Singleplayer button
So the logic is:
- on title screen + press
1→ click Singleplayer - anywhere else + press
1→ nothing happens
If you want, I can also help you with the exact FancyMenu block layout, like which menu item to click first and what each IF should be set to 🙂
There is no text, it's like choosing things
I’m checking how the UI does multiple conditions, because it sounds like FancyMenu uses selectable requirements instead of typed script text 🙂
Yep, that’s normal in FancyMenu 🙂 You’re not supposed to type a full script there, you just pick conditions from the UI.
Do it like this:
- Open the listener
- Add an IF
- In that IF, choose a screen check
- either Is Screen Title
- or a screen identifier check if that’s what your UI shows
- Inside that IF, add another IF
- In the second IF, choose the keyboard variable, usually
$$key_name - Set it to
1 - Put the Mimic Vanilla/Mod Button action inside the second IF
So the structure is basically:
- IF: on title screen
- IF: key pressed is
1- click Singleplayer
- IF: key pressed is
If your UI has a way to add multiple requirements in one IF, that would also work, but the safest way is to just nest two IFs.
If you want, I can help you identify exactly which dropdown option to pick for the screen check and the key check based on what you see in your menu screen 🙂
Looks like it cant happen in fanccymenu, thanks for trying anyway
Got it, I’m just checking whether there’s any documented FancyMenu workaround before I answer back 🙂
Yep, fair enough 🙂 FancyMenu can listen for key presses, but there isn’t a clearly documented, reliable way to bind 1 to the vanilla Singleplayer button on the title screen.
So I’d treat this as not really supported in FancyMenu.
If you want, I can still help with another FancyMenu menu tweak or workaround idea 🙌
This support thread has been marked as solved by @elder brook.
The AI helper is now disabled.