diff --git a/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch b/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch index 41a80a227..f80019f4b 100644 --- a/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch +++ b/patches/minecraft/net/minecraft/client/settings/KeyBinding.java.patch @@ -53,7 +53,7 @@ public boolean func_151470_d() { - return this.field_74513_e; -+ return this.field_74513_e && getKeyConflictContext().isActive() && (!allowsKeyModifiers || getKeyModifier().isActive()); ++ return this.field_74513_e && getKeyConflictContext().isActive() && getKeyModifier().isActive(); } public String func_151466_e() @@ -110,7 +110,7 @@ + */ + public boolean isActiveAndMatches(int keyCode) + { -+ return keyCode == this.func_151463_i() && getKeyConflictContext().isActive() && (!allowsKeyModifiers || getKeyModifier().isActive()); ++ return keyCode == this.func_151463_i() && getKeyConflictContext().isActive() && getKeyModifier().isActive(); + } + + public void setKeyConflictContext(net.minecraftforge.client.settings.IKeyConflictContext keyConflictContext) @@ -136,7 +136,7 @@ + } + else + { -+ return net.minecraftforge.client.settings.KeyModifier.NONE; ++ return net.minecraftforge.client.settings.KeyModifier.NOT_SUPPORTED; + } + } + diff --git a/src/main/java/net/minecraftforge/client/settings/KeyBindingMap.java b/src/main/java/net/minecraftforge/client/settings/KeyBindingMap.java index e1c5f4ed6..4524544a0 100644 --- a/src/main/java/net/minecraftforge/client/settings/KeyBindingMap.java +++ b/src/main/java/net/minecraftforge/client/settings/KeyBindingMap.java @@ -22,7 +22,17 @@ public class KeyBindingMap public KeyBinding lookupActive(int keyCode) { KeyModifier activeModifier = KeyModifier.isKeyCodeModifier(keyCode) ? KeyModifier.NONE : KeyModifier.getActiveModifier(); - Collection bindings = map.get(activeModifier).lookup(keyCode); + KeyBinding binding = getBinding(keyCode, activeModifier); + if (binding != null) + { + return binding; + } + return getBinding(keyCode, KeyModifier.NOT_SUPPORTED); + } + + private KeyBinding getBinding(int keyCode, KeyModifier keyModifier) + { + Collection bindings = map.get(keyModifier).lookup(keyCode); if (bindings != null) { for (KeyBinding binding : bindings) diff --git a/src/main/java/net/minecraftforge/client/settings/KeyModifier.java b/src/main/java/net/minecraftforge/client/settings/KeyModifier.java index 6eb699fe3..54c0c8860 100644 --- a/src/main/java/net/minecraftforge/client/settings/KeyModifier.java +++ b/src/main/java/net/minecraftforge/client/settings/KeyModifier.java @@ -83,6 +83,25 @@ public enum KeyModifier { return !SHIFT.isActive() && !CONTROL.isActive() && !ALT.isActive(); } + @Override + public String getLocalizedComboName(String keyName) + { + return keyName; + } + }, + NOT_SUPPORTED { + @Override + protected boolean matches(int keyCode) + { + return true; + } + + @Override + public boolean isActive() + { + return true; + } + @Override public String getLocalizedComboName(String keyName) {