PowerToys/src/core/Microsoft.PowerToys.Settings.UI.Lib/HotkeySettings.cs

52 lines
1.1 KiB
C#
Raw Normal View History

2020-04-08 15:19:00 +08:00
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text;
namespace Microsoft.PowerToys.Settings.UI.Lib
{
public class HotkeySettings
{
public bool win { get; set; }
2020-04-08 15:19:00 +08:00
public bool ctrl { get; set; }
2020-04-08 15:19:00 +08:00
public bool alt { get; set; }
2020-04-08 15:19:00 +08:00
public bool shift { get; set; }
2020-04-08 15:19:00 +08:00
public string key { get; set; }
2020-04-08 15:19:00 +08:00
public int code { get; set; }
public override string ToString()
{
StringBuilder output = new StringBuilder();
if (win)
{
output.Append("Win + ");
}
2020-04-08 15:19:00 +08:00
if (ctrl)
{
output.Append("Ctrl + ");
}
2020-04-08 15:19:00 +08:00
if (alt)
{
output.Append("Alt + ");
}
2020-04-08 15:19:00 +08:00
if (shift)
{
output.Append("Shift + ");
}
2020-04-08 15:19:00 +08:00
output.Append(key);
return output.ToString();
}
}
}