Add toggle inventory/crafting with E and C/R keys#593
Merged
codeHusky merged 1 commit intosmartcmd:mainfrom Mar 7, 2026
Merged
Add toggle inventory/crafting with E and C/R keys#593codeHusky merged 1 commit intosmartcmd:mainfrom
codeHusky merged 1 commit intosmartcmd:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add toggle behavior for inventory and crafting menus when using keyboard (E and C/R keys). Previously, pressing the key again while the menu was open does not close the menu.
Changes
Previous Behavior
When pressing the inventory key (E) or crafting key (C/R), the corresponding menu would open. However, pressing the same key again while the menu was already open would not close it.
Root Cause
The keyboard input polling code in Minecraft.cpp (inside the _WINDOWS64 KBM input block) does not check whether a container menu is already open.
New Behavior
Pressing E while a container menu (inventory, crafting, chest, etc.) is open will now close it. Pressing C/R while a container menu is open will also close it. This matches the expected toggle behavior from Java Edition.
Fix Implementation
In Minecraft.cpp handlers now check ui.IsSceneInStack. If a container menu is already displayed, ui.CloseUIScenes(i) is called instead of setting the action flag.
AI Use Disclosure
I used AI as a search tool to navigate the codebase and find the required UI controller APIs (like IsSceneInStack), but the logic and implementation are completely my own.
Related Issues