From e24a027f7daab08274328de70c46883259119e7b Mon Sep 17 00:00:00 2001 From: Guntram Blohm Date: Thu, 5 Nov 2020 12:44:11 +0100 Subject: [PATCH] pressing the advancements keybind ('L') when typing in the search box doesn't end the screen --- .../advancementinfo/mixin/AdvancementScreenMixin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/guntram/mcmod/advancementinfo/mixin/AdvancementScreenMixin.java b/src/main/java/de/guntram/mcmod/advancementinfo/mixin/AdvancementScreenMixin.java index 66adb8c..84c0851 100644 --- a/src/main/java/de/guntram/mcmod/advancementinfo/mixin/AdvancementScreenMixin.java +++ b/src/main/java/de/guntram/mcmod/advancementinfo/mixin/AdvancementScreenMixin.java @@ -181,12 +181,12 @@ public boolean mouseScrolled(double X, double Y, double amount /*, CallbackInfoR public void redirectKeysToSearch(int keyCode, int scanCode, int modifiers, CallbackInfoReturnable cir) { if (search.isActive()) { if (keyCode == GLFW.GLFW_KEY_ENTER) { - System.out.println("now"); AdvancementInfo.setMatchingFrom((AdvancementsScreen)(Object)this, search.getText()); - cir.setReturnValue(true); - cir.cancel(); } - if (search.keyPressed(keyCode, scanCode, modifiers)) { + search.keyPressed(keyCode, scanCode, modifiers); + // Only let ESCAPE end the screen, we don't want the keybind ('L') + // to terminate the screen when we're typing text + if (keyCode != GLFW.GLFW_KEY_ESCAPE) { cir.setReturnValue(true); cir.cancel(); }