From 9fc1121998d623f272a5f6b41bd513fd9de4e80f Mon Sep 17 00:00:00 2001 From: Stone_Red <56473591+Stone-Red-Code@users.noreply.github.com> Date: Thu, 26 Mar 2026 20:44:50 +0100 Subject: [PATCH] Update key handling to trigger actions only on key release events --- .../UserInterface/Screens/WorldScreen.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StoneRed.LogicSimulator/UserInterface/Screens/WorldScreen.cs b/StoneRed.LogicSimulator/UserInterface/Screens/WorldScreen.cs index 4858038..fa99a1d 100644 --- a/StoneRed.LogicSimulator/UserInterface/Screens/WorldScreen.cs +++ b/StoneRed.LogicSimulator/UserInterface/Screens/WorldScreen.cs @@ -253,12 +253,12 @@ internal class WorldScreen : SrlsScreen } } - if (keyboardState.IsKeyDown(Keys.C)) + if (keyboardState.WasKeyJustUp(Keys.C)) { UnSelectLogicGate(); } - if (keyboardState.IsKeyDown(Keys.Q)) + if (keyboardState.WasKeyJustUp(Keys.Escape)) { blockInput = true; @@ -268,7 +268,7 @@ internal class WorldScreen : SrlsScreen srls.ShowWindow(new QuickMenu(worldData)); } - if (keyboardState.IsKeyDown(Keys.Home)) + if (keyboardState.WasKeyJustUp(Keys.Home)) { camera.Position = Vector2.Zero; }