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.
|
|
|
|
|
|
2020-04-04 10:02:38 +08:00
|
|
|
|
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
|
|
|
|
|
2020-04-04 10:02:38 +08:00
|
|
|
|
public bool ctrl { get; set; }
|
2020-04-08 15:19:00 +08:00
|
|
|
|
|
2020-04-04 10:02:38 +08:00
|
|
|
|
public bool alt { get; set; }
|
2020-04-08 15:19:00 +08:00
|
|
|
|
|
2020-04-04 10:02:38 +08:00
|
|
|
|
public bool shift { get; set; }
|
2020-04-08 15:19:00 +08:00
|
|
|
|
|
2020-04-04 10:02:38 +08:00
|
|
|
|
public string key { get; set; }
|
2020-04-08 15:19:00 +08:00
|
|
|
|
|
2020-04-04 10:02:38 +08:00
|
|
|
|
public int code { get; set; }
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
StringBuilder output = new StringBuilder();
|
|
|
|
|
|
2020-04-11 06:22:07 +08:00
|
|
|
|
if (win)
|
2020-04-04 10:02:38 +08:00
|
|
|
|
{
|
|
|
|
|
output.Append("Win + ");
|
|
|
|
|
}
|
2020-04-08 15:19:00 +08:00
|
|
|
|
|
2020-04-11 06:22:07 +08:00
|
|
|
|
if (ctrl)
|
2020-04-04 10:02:38 +08:00
|
|
|
|
{
|
|
|
|
|
output.Append("Ctrl + ");
|
|
|
|
|
}
|
2020-04-08 15:19:00 +08:00
|
|
|
|
|
2020-04-11 06:22:07 +08:00
|
|
|
|
if (alt)
|
2020-04-04 10:02:38 +08:00
|
|
|
|
{
|
|
|
|
|
output.Append("Alt + ");
|
|
|
|
|
}
|
2020-04-08 15:19:00 +08:00
|
|
|
|
|
2020-04-11 06:22:07 +08:00
|
|
|
|
if (shift)
|
2020-04-04 10:02:38 +08:00
|
|
|
|
{
|
|
|
|
|
output.Append("Shift + ");
|
|
|
|
|
}
|
2020-04-08 15:19:00 +08:00
|
|
|
|
|
2020-04-11 06:22:07 +08:00
|
|
|
|
output.Append(key);
|
2020-04-04 10:02:38 +08:00
|
|
|
|
return output.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|