Skip to content

Commit 66d59a5

Browse files
committed
fix getting stuck in kb&m input mode
1 parent c42d4d3 commit 66d59a5

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/main/java/dev/isxander/controlify/Controlify.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -581,14 +581,14 @@ public void setCurrentController(@Nullable ControllerEntity controller, boolean
581581
}
582582

583583
@Override
584-
public boolean setInputMode(@NotNull InputMode currentInputMode) {
585-
if (this.currentInputMode == currentInputMode) return false;
586-
if (this.currentInputMode.isController() && this.getCurrentController().isEmpty()) {
584+
public boolean setInputMode(@NotNull InputMode newInputMode) {
585+
if (this.currentInputMode == newInputMode) return false;
586+
if (newInputMode.isController() && this.getCurrentController().isEmpty()) {
587587
DebugLog.log("Attempted to switch to controller input mode with no current controller set.");
588588
return false;
589589
}
590590

591-
this.currentInputMode = currentInputMode;
591+
this.currentInputMode = newInputMode;
592592

593593
// Track consecutive input mode switches to prevent softlock
594594
if (Blaze3D.getTime() - lastInputSwitchTime < 20) {
@@ -599,7 +599,7 @@ public boolean setInputMode(@NotNull InputMode currentInputMode) {
599599
lastInputSwitchTime = Blaze3D.getTime();
600600

601601
if (!minecraft.mouseHandler.isMouseGrabbed()) {
602-
hideMouse(currentInputMode.isController(), true);
602+
hideMouse(newInputMode.isController(), true);
603603
}
604604

605605
this.setupForController(this.currentInputMode.isController() ? this.currentController : null);
@@ -616,11 +616,11 @@ public boolean setInputMode(@NotNull InputMode currentInputMode) {
616616

617617
// notify current screen of input mode change
618618
if (minecraft.screen != null) {
619-
ScreenProcessorProvider.provide(minecraft.screen).onInputModeChanged(currentInputMode);
619+
ScreenProcessorProvider.provide(minecraft.screen).onInputModeChanged(newInputMode);
620620
}
621621

622622
// notify event listeners of input mode change
623-
ControlifyEvents.INPUT_MODE_CHANGED.invoke(new ControlifyEvents.InputModeChanged(currentInputMode));
623+
ControlifyEvents.INPUT_MODE_CHANGED.invoke(new ControlifyEvents.InputModeChanged(newInputMode));
624624

625625
return true;
626626
}

0 commit comments

Comments
 (0)