-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathHotkeyData.cs
47 lines (45 loc) · 1.23 KB
/
HotkeyData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Echoes
{
public class HotkeyData
{
public Hotkey hotkey;
public Keys key;
//public int mod;
public bool alt, shift, ctrl;
public bool enabled;
public bool registered = false;
public HotkeyData(Hotkey hotkey, Keys key, bool ctrl, bool alt, bool shift, bool enabled)
{
this.hotkey = hotkey;
this.key = key;
this.alt = alt;
this.shift = shift;
this.ctrl = ctrl;
this.enabled = enabled;
}
public string ModToString()
{
if (!(alt || shift || ctrl)) return "None";
List<string> btns = new List<string>();
string ret = "";
if (ctrl) btns.Add("Ctrl");
if (alt) btns.Add("Alt");
if (shift) btns.Add("Shift");
for (int i = 0; i < btns.Count; i++)
{
ret += btns[i];
if (i < btns.Count - 1)
{
ret += " + ";
}
}
return ret;
}
}
}