From 85a46c0bba8c17e1d60d3ab7382a38aa2c7277dd Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sun, 27 Sep 2026 18:43:27 +0200 Subject: [PATCH] Close the emote wheel with its key The emote wheel key only opened the wheel. It now closes it too while the wheel is open. This is done in the key handler: closing from the screen would reopen it on the next tick, since the key is still down by then. Co-Authored-By: Claude Opus 5.5 --- .../saturnclient/event/KeyInputHandler.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/saturnclient/saturnclient/event/KeyInputHandler.java b/src/main/java/org/saturnclient/saturnclient/event/KeyInputHandler.java index adecfba..5f7d9d7 100644 --- a/src/main/java/org/saturnclient/saturnclient/event/KeyInputHandler.java +++ b/src/main/java/org/saturnclient/saturnclient/event/KeyInputHandler.java @@ -12,6 +12,7 @@ import org.saturnclient.saturnclient.SaturnClient; import org.saturnclient.common.provider.Providers; import org.saturnclient.client.ServiceClient; import org.saturnclient.emotes.fabric.Emotes; +import org.saturnclient.impl.ui.SaturnScreenFabric; import org.saturnclient.ui.screens.EmoteWheel; import org.saturnclient.ui.screens.ShiftMenu; @@ -51,12 +52,20 @@ public class KeyInputHandler { Providers.saturn.getClient().setScreen(new ShiftMenu()); } - if (Config.openEmoteWheel.wasKeyPressed() && client.currentScreen == null + // The emote wheel key opens the wheel, and closes it again while it's open. Closing it + // from the screen's own key handling would reopen it on the next tick, since the key is + // still down and no screen is open by then. + if (Config.openEmoteWheel.wasKeyPressed() //? if >=1.21.9 { && !InputUtil.isKeyPressed(client.getWindow(), GLFW.GLFW_KEY_F3)) { //?} else //&& !InputUtil.isKeyPressed(client.getWindow().getHandle(), GLFW.GLFW_KEY_F3)) { - Providers.saturn.getClient().setScreen(new EmoteWheel()); + if (client.currentScreen == null) { + Providers.saturn.getClient().setScreen(new EmoteWheel()); + } else if (client.currentScreen instanceof SaturnScreenFabric saturnScreen + && saturnScreen.screen instanceof EmoteWheel) { + saturnScreen.close(); + } } // Sneaking cancels your own emote, for everyone.