aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gradle.properties2
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java17
2 files changed, 5 insertions, 14 deletions
diff --git a/gradle.properties b/gradle.properties
index 9a05455..4d860e1 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.11.6
# Mod Properties
- mod_version = 4.2.0
+ mod_version = 4.2.1
maven_group = io.github.cottonmc
archives_base_name = LibGui
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;