From 1dc8986c22cec2011005cc77f5f6a0d5fa691f55 Mon Sep 17 00:00:00 2001 From: aQaTL <mmsoltys@outlook.com> Date: Wed, 18 Apr 2018 15:06:03 +0200 Subject: [PATCH] Switched back to switch --- osu.Game/Overlays/KeyBinding/KeyBindingRow.cs | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs index 6926e3d966..4e06ce8211 100644 --- a/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs +++ b/osu.Game/Overlays/KeyBinding/KeyBindingRow.cs @@ -198,22 +198,25 @@ namespace osu.Game.Overlays.KeyBinding if (!HasFocus) return false; - KeyCombination keyCombination = KeyCombination.FromInputState(state); - - if (keyCombination.Equals(InputKey.Escape)) + switch (args.Key) { - finalise(); - return true; + case Key.Escape: + finalise(); + return true; + case Key.Delete: + { + if (state.Keyboard.ShiftPressed) + { + bindTarget.UpdateKeyCombination(InputKey.None); + finalise(); + return true; + } + + break; + } } - if (keyCombination.Equals(new[] { InputKey.Shift, InputKey.Delete })) - { - bindTarget.UpdateKeyCombination(InputKey.None); - finalise(); - return true; - } - - bindTarget.UpdateKeyCombination(keyCombination); + bindTarget.UpdateKeyCombination(KeyCombination.FromInputState(state)); if (!isModifier(args.Key)) finalise(); return true;