Skip to content

Commit

Permalink
Bug fixes for Shortcut Assistant Layer
Browse files Browse the repository at this point in the history
Signed-off-by: Alex <[email protected]>
  • Loading branch information
xQwexx committed Apr 3, 2020
1 parent b6a5c40 commit 0200530
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public override void Default()
_DimBackground = true;
_DimColor = Color.FromArgb(169, 0, 0, 0);
_PresentationType = ShortcutAssistantPresentationType.Default;
_MergeModifierKey = true;
_MergeModifierKey = false;
}
}

Expand All @@ -129,8 +129,6 @@ public override EffectLayer Render(IGameState gamestate)

Keys[] heldKeys = Global.InputEvents.PressedKeys;



Tree<Keys> _childKeys = Properties.ShortcutKeysTree;
foreach (var key in heldKeys)
{
Expand All @@ -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);

}
}

Expand Down
7 changes: 5 additions & 2 deletions Project-Aurora/Project-Aurora/Utils/KeyUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

/// <summary>
/// Converts CorsairLedId to Devices.DeviceKeys
/// </summary>
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0200530

Please sign in to comment.