Improve hotkey model

This commit is contained in:
Jack251970 2025-06-26 09:24:59 +08:00
parent 0aff9e33de
commit 53e0bc33ab

View file

@ -117,12 +117,22 @@ namespace Flow.Launcher.Infrastructure.Hotkey
}
}
public override string ToString()
public bool Equals(HotkeyModel other)
{
return CharKey == other.CharKey && ModifierKeys == other.ModifierKeys;
}
public KeyGesture ToKeyGesture()
{
return new KeyGesture(CharKey, ModifierKeys);
}
public override readonly string ToString()
{
return string.Join(" + ", EnumerateDisplayKeys());
}
public IEnumerable<string> EnumerateDisplayKeys()
public readonly IEnumerable<string> EnumerateDisplayKeys()
{
if (Ctrl && CharKey is not (Key.LeftCtrl or Key.RightCtrl))
{