From 524e8875d0b23c710e9510a28d7980151e24def3 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 3 Jan 2020 21:52:13 +0000 Subject: [PATCH] Restore MODIFIER_OVERRIDES handling of unmodified attack move hotkey. --- .../Widgets/Logic/Ingame/CommandBarLogic.cs | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/CommandBarLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/CommandBarLogic.cs index 3c47162b04..0cf8ffb504 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/CommandBarLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/CommandBarLogic.cs @@ -209,9 +209,6 @@ namespace OpenRA.Mods.Common.Widgets var noShiftButtons = new[] { guardButton, deployButton, attackMoveButton }; keyOverrides.AddHandler(e => { - if (e.Event != KeyInputEvent.Down) - return false; - // HACK: allow command buttons to be triggered if the shift (queue order modifier) key is held if (e.Modifiers.HasModifier(Modifiers.Shift)) { @@ -228,18 +225,15 @@ namespace OpenRA.Mods.Common.Widgets } } - // HACK: allow attack move to be triggered if the ctrl (assault move modifier) - // or shift (queue order modifier) keys are pressed - if (e.Modifiers.HasModifier(Modifiers.Ctrl)) - { - var eNoMods = e; - eNoMods.Modifiers &= ~(Modifiers.Ctrl | Modifiers.Shift); + // HACK: Attack move can be triggered if the ctrl (assault move modifier) + // or shift (queue order modifier) keys are pressed, on both key down and key up + var eNoMods = e; + eNoMods.Modifiers &= ~(Modifiers.Ctrl | Modifiers.Shift); - if (attackMoveButton != null && !attackMoveDisabled && attackMoveButton.Key.IsActivatedBy(eNoMods)) - { - attackMoveButton.OnKeyPress(e); - return true; - } + if (attackMoveButton != null && !attackMoveDisabled && attackMoveButton.Key.IsActivatedBy(eNoMods)) + { + attackMoveButton.OnKeyPress(e); + return true; } return false;