From 0ce5c7468fcf155dea67469182fae578abecdaf7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 7 Jun 2019 15:31:23 +0900 Subject: [PATCH] Use switch and consume/block input --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index a7ba87e72a..501679af03 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -197,10 +197,16 @@ namespace osu.Game.Overlays.Mods protected override bool OnKeyDown(KeyDownEvent e) { - if (e.Key == Key.Number1) - DeselectAllButton.Click(); - else if (e.Key == Key.Number2) - CloseButton.Click(); + switch (e.Key) + { + case Key.Number1: + DeselectAllButton.Click(); + return true; + + case Key.Number2: + CloseButton.Click(); + return true; + } return base.OnKeyDown(e); }