diff --git a/src/main/java/moze_intel/projecte/gameObjs/gui/GUITransmutation.java b/src/main/java/moze_intel/projecte/gameObjs/gui/GUITransmutation.java index 1b7d69277..1a9f3311e 100644 --- a/src/main/java/moze_intel/projecte/gameObjs/gui/GUITransmutation.java +++ b/src/main/java/moze_intel/projecte/gameObjs/gui/GUITransmutation.java @@ -121,7 +121,16 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { //This is where key combos and deletion is handled, and where we bypass the inventory key closing the screen return textBoxFilter.keyPressed(keyCode, scanCode, modifiers); } - return super.keyPressed(keyCode, scanCode, modifiers); + boolean passedThrough = super.keyPressed(keyCode, scanCode, modifiers); + if (passedThrough) { + return true; + } + // try passing the unhandled key to textbox + boolean handled = textBoxFilter.keyPressed(keyCode, scanCode, modifiers); + if (handled) { + textBoxFilter.setFocused(true); + } + return handled; } private void updateFilter(String text) { @@ -175,4 +184,4 @@ protected void renderTooltip(@NotNull GuiGraphics graphics, int mouseX, int mous super.renderTooltip(graphics, mouseX, mouseY); } } -} \ No newline at end of file +}