mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Profile editor - Added back hotkeys for the tools
Profile editor - Fixed hotkeys not always working
This commit is contained in:
1 parent
f985682e78
commit
543b62a715
16 files changed
+106
-38
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Artemis.Core.Services;
|
||||
using System;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.Storage.Entities.Profile;
|
||||
|
||||
namespace Artemis.Core;
|
||||
@@ -16,6 +17,14 @@ public class Hotkey : CorePropertyChanged, IStorageModel
|
||||
Entity = new ProfileConfigurationHotkeyEntity();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public Hotkey(KeyboardKey? key, KeyboardModifierKey? modifiers)
|
||||
{
|
||||
Key = key;
|
||||
Modifiers = modifiers;
|
||||
Entity = new ProfileConfigurationHotkeyEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="Hotkey" /> based on the provided entity
|
||||
/// </summary>
|
||||
@@ -46,7 +55,7 @@ public class Hotkey : CorePropertyChanged, IStorageModel
|
||||
/// <returns><see langword="true" /> if the event args match the hotkey; otherwise <see langword="false" /></returns>
|
||||
public bool MatchesEventArgs(ArtemisKeyboardKeyEventArgs eventArgs)
|
||||
{
|
||||
return eventArgs.Key == Key && eventArgs.Modifiers == Modifiers;
|
||||
return eventArgs.Key == Key && (eventArgs.Modifiers == Modifiers || (eventArgs.Modifiers == KeyboardModifierKey.None && Modifiers == null));
|
||||
}
|
||||
|
||||
#region Implementation of IStorageModel
|
||||
|
||||
Reference in new issue
Block a user