From a60452b30a0c09f0f595ff4d83b61d1659e567c5 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 8 Oct 2014 20:33:06 +1300 Subject: [PATCH] Make the video cancel hotkey configurable. --- OpenRA.Game/Widgets/VqaPlayerWidget.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/OpenRA.Game/Widgets/VqaPlayerWidget.cs b/OpenRA.Game/Widgets/VqaPlayerWidget.cs index e42801f9ff..35b4d661bf 100644 --- a/OpenRA.Game/Widgets/VqaPlayerWidget.cs +++ b/OpenRA.Game/Widgets/VqaPlayerWidget.cs @@ -18,6 +18,7 @@ namespace OpenRA.Widgets { public class VqaPlayerWidget : Widget { + public Hotkey CancelKey = new Hotkey(Keycode.ESCAPE, Modifiers.None); public float AspectRatio = 1.2f; public bool DrawOverlay = true; @@ -116,16 +117,11 @@ namespace OpenRA.Widgets public override bool HandleKeyPress(KeyInput e) { - if (e.Event == KeyInputEvent.Down) - { - if (e.Key == Keycode.ESCAPE) - { - Stop(); - return true; - } - } + if (Hotkey.FromKeyInput(e) != CancelKey || e.Event != KeyInputEvent.Down) + return false; - return false; + Stop(); + return true; } public void Play()