From 143da0a94049ed75a8c4ba3f5ff2a46ebcbf8b83 Mon Sep 17 00:00:00 2001 From: Dustin Norberg Date: Thu, 24 Sep 2026 04:27:51 -0400 Subject: [PATCH] Keep notebook rename keys out of inventory shortcuts --- gradle.properties | 2 +- .../rivencraft/client/screen/NotebookScreen.java | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 98e9d96..e48cb67 100644 --- a/gradle.properties +++ b/gradle.properties @@ -35,7 +35,7 @@ mod_name=Rivencraft # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=LGPL-3.0-or-later # The mod version. Rivencraft uses the x.y.z.b policy documented in README.md. -mod_version=0.3.3.3 +mod_version=0.3.3.4 immersive_portals_version=6.0.7 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. diff --git a/src/main/java/net/dnorberg/rivencraft/client/screen/NotebookScreen.java b/src/main/java/net/dnorberg/rivencraft/client/screen/NotebookScreen.java index 3d6f223..23a61cf 100644 --- a/src/main/java/net/dnorberg/rivencraft/client/screen/NotebookScreen.java +++ b/src/main/java/net/dnorberg/rivencraft/client/screen/NotebookScreen.java @@ -163,8 +163,18 @@ public final class NotebookScreen extends AbstractContainerScreen @Override public boolean keyPressed(int keyCode, int scanCode, int modifiers) { - if (renaming && textInput.isFocused() && (keyCode == 257 || keyCode == 335)) { - finishRename(); + if (textInput.isFocused()) { + if (renaming && (keyCode == 257 || keyCode == 335)) { + finishRename(); + } else if (keyCode == 256) { + if (renaming) finishRename(); + setFocused(null); + textInput.setFocused(false); + } else { + textInput.keyPressed(keyCode, scanCode, modifiers); + } + // EditBox does not consume ordinary letter key presses; the matching charTyped + // event handles text input. Do not pass them to the container's inventory keys. return true; } if (!textInput.isFocused() && keyCode == 82 && selectedSlot >= 0) {