Rework KeyModifiers system to properly allow keybinds to be triggered when multiple modifiers are pressed.

Fix setting keybinds whel using keyboard inputs to select the menu. Closes #9793
This commit is contained in:
LexManos committed 2023-11-28 19:10:07 -08:00
1 parent 4ac1a3dedf
commit c1557ec3c2
6 files changed
+68 -40

No files matched your search

@@ -1,25 +1,5 @@
--- a/net/minecraft/client/KeyboardHandler.java
+++ b/net/minecraft/client/KeyboardHandler.java
@@ -340,7 +_,9 @@
}
}
- if (p_90897_ == 1 && (!(this.minecraft.screen instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).lastKeySelection <= Util.getMillis() - 20L)) {
+
+ if ((!(this.minecraft.screen instanceof KeyBindsScreen) || ((KeyBindsScreen)screen).lastKeySelection <= Util.getMillis() - 20L)) {
+ if (p_90897_ == 1) {
if (this.minecraft.options.keyFullscreen.matches(p_90895_, p_90896_)) {
this.minecraft.getWindow().toggleFullScreen();
this.minecraft.options.fullscreen().set(this.minecraft.getWindow().isFullscreen());
@@ -358,6 +_,8 @@
});
return;
}
+ } else if (p_90897_ == 0 /*GLFW_RELEASE*/ && this.minecraft.screen instanceof KeyBindsScreen)
+ ((KeyBindsScreen)this.minecraft.screen).selectedKey = null; //Forge: Unset pure modifiers.
}
if (this.minecraft.getNarrator().isActive() && this.minecraft.options.narratorHotkey().get()) {
@@ -380,11 +_,15 @@
Screen.wrapScreenError(() -> {
if (p_90897_ != 1 && p_90897_ != 2) {