From 0200530e18f1653549b6ca7dee2992024a9fbef5 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 8 Dec 2019 19:31:29 +0100 Subject: [PATCH] Bug fixes for Shortcut Assistant Layer Signed-off-by: Alex --- .../Layers/ShortcutAssistantLayerHandler.cs | 18 ++++++++++++------ .../Project-Aurora/Utils/KeyUtils.cs | 7 +++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Project-Aurora/Project-Aurora/Settings/Layers/ShortcutAssistantLayerHandler.cs b/Project-Aurora/Project-Aurora/Settings/Layers/ShortcutAssistantLayerHandler.cs index c49112a2a..420508d50 100644 --- a/Project-Aurora/Project-Aurora/Settings/Layers/ShortcutAssistantLayerHandler.cs +++ b/Project-Aurora/Project-Aurora/Settings/Layers/ShortcutAssistantLayerHandler.cs @@ -107,7 +107,7 @@ public override void Default() _DimBackground = true; _DimColor = Color.FromArgb(169, 0, 0, 0); _PresentationType = ShortcutAssistantPresentationType.Default; - _MergeModifierKey = true; + _MergeModifierKey = false; } } @@ -129,8 +129,6 @@ public override EffectLayer Render(IGameState gamestate) Keys[] heldKeys = Global.InputEvents.PressedKeys; - - Tree _childKeys = Properties.ShortcutKeysTree; foreach (var key in heldKeys) { @@ -149,11 +147,19 @@ public override EffectLayer Render(IGameState gamestate) if(shortcutKeys.Length > 0) { + + Devices.DeviceKeys[] selectedKeys = Utils.KeyUtils.GetDeviceKeys(shortcutKeys, true, !Console.NumberLock) + .Concat(Utils.KeyUtils.GetDeviceKeys(heldKeys, true)).ToArray(); + if (Properties.DimBackground) - sc_assistant_layer.Fill(Properties.DimColor); + { + Devices.DeviceKeys[] backgroundKeys = Utils.KeyUtils.GetDeviceAllKeys().Except(selectedKeys).ToArray(); + sc_assistant_layer.Set(backgroundKeys, Properties.DimColor); + //sc_assistant_layer.Fill(Properties.DimColor); + } - sc_assistant_layer.Set(Utils.KeyUtils.GetDeviceKeys(shortcutKeys, true, !Console.NumberLock), Properties.PrimaryColor); - sc_assistant_layer.Set(Utils.KeyUtils.GetDeviceKeys(heldKeys, true), Properties.PrimaryColor); + sc_assistant_layer.Set(selectedKeys, Properties.PrimaryColor); + } } diff --git a/Project-Aurora/Project-Aurora/Utils/KeyUtils.cs b/Project-Aurora/Project-Aurora/Utils/KeyUtils.cs index c5aba21e9..9a15169c7 100755 --- a/Project-Aurora/Project-Aurora/Utils/KeyUtils.cs +++ b/Project-Aurora/Project-Aurora/Utils/KeyUtils.cs @@ -898,6 +898,11 @@ public static DeviceKeys[] GetDeviceKeys(Keys[] formsKeys, bool extendedKeys = f return _returnKeys.ToArray(); } + public static DeviceKeys[] GetDeviceAllKeys() + { + return (DeviceKeys[])Enum.GetValues(typeof(DeviceKeys)); + } + /// /// Converts CorsairLedId to Devices.DeviceKeys /// @@ -1193,8 +1198,6 @@ public static Keys GetStandardKey(Keys key) { case Keys.RControlKey: return Keys.LControlKey; - case Keys.RMenu: - return Keys.LMenu; case Keys.RShiftKey: return Keys.LShiftKey; case Keys.RWin: