diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2021-09-12 15:23:48 +0300 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2021-09-12 15:23:48 +0300 |
commit | 8eb2a20924b4aacd9d3f470d52191ff9165c6042 (patch) | |
tree | 0e55024a2409f3f0814779eec6a28130e50fc910 /src | |
parent | c6cf5ebf90de7abea4c44a8ed0126d24e6f05ba5 (diff) | |
download | LibGui-8eb2a20924b4aacd9d3f470d52191ff9165c6042.tar.gz LibGui-8eb2a20924b4aacd9d3f470d52191ff9165c6042.tar.bz2 LibGui-8eb2a20924b4aacd9d3f470d52191ff9165c6042.zip |
Fix #137, bump version to 4.2.14.2.1
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java index 953563c..82d8d4b 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java @@ -163,21 +163,12 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl @Override public boolean keyPressed(int ch, int keyCode, int modifiers) { - //System.out.println("Key " + Integer.toHexString(ch)+" "+Integer.toHexString(keyCode)); - if (ch==GLFW.GLFW_KEY_ESCAPE) { - onClose(); - return true; - } else if (ch==GLFW.GLFW_KEY_TAB) { - changeFocus(!hasShiftDown()); - return true; + if (ch == GLFW.GLFW_KEY_ESCAPE || ch == GLFW.GLFW_KEY_TAB) { + // special hardcoded keys, these will never be delivered to widgets + return super.keyPressed(ch, keyCode, modifiers); } else { - //if (super.keyPressed(ch, keyCode, modifiers)) return true; if (description.getFocus()==null) { - if (client.options.keyInventory.matchesKey(ch, keyCode)) { - this.client.player.closeHandledScreen(); - return true; - } - return false; + return super.keyPressed(ch, keyCode, modifiers); } else { description.getFocus().onKeyPressed(ch, keyCode, modifiers); return true; |