1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-24 14:50:10 +00:00
msfs-popout-panel-manager/DomainModel/Setting/KeyboardShortcutSetting.cs

38 lines
1.1 KiB
C#
Raw Normal View History

2024-03-03 05:02:21 +00:00
using System.Collections.Generic;
using System.Linq;
using MSFSPopoutPanelManager.Shared;
using Newtonsoft.Json;
namespace MSFSPopoutPanelManager.DomainModel.Setting
{
public class KeyboardShortcutSetting : ObservableObject
{
2024-03-03 05:02:21 +00:00
private string _startPopOutKeyBindingLegacyConversion;
2024-02-28 02:44:21 +00:00
public bool IsEnabled { get; set; } = true;
2024-03-03 05:02:21 +00:00
public string StartPopOutKeyBinding
{
get => _startPopOutKeyBindingLegacyConversion;
set
{
// Convert legacy start pop out keyboard binding to new keyboard bindings (v4.0.3 and earlier)
if (string.IsNullOrEmpty(value))
return;
var keys = new List<string>() { "LeftCtrl", "LeftShift", value.ToUpper() };
keys = keys.OrderBy(x => x).ToList();
PopOutKeyboardBinding = string.Join("|", keys);
_startPopOutKeyBindingLegacyConversion = null;
}
}
public string PopOutKeyboardBinding { get; set; }
[JsonIgnore]
public bool IsDetectingKeystroke { get; set; }
}
}