-
Notifications
You must be signed in to change notification settings - Fork 6
/
KeyPressCheck.cs
50 lines (46 loc) · 1.53 KB
/
KeyPressCheck.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
48
49
50
using System.Windows.Forms;
namespace TarkovPriceViewer
{
public partial class KeyPressCheck : Form
{
private int button;
public KeyPressCheck(int button)
{
this.button = button;
InitializeComponent();
}
private void KeyPressCheck_FormClosed(object sender, FormClosedEventArgs e)
{
if (Owner != null)
{
((MainForm)Owner).ChangePressKeyData(null);
}
}
private void KeyPressCheck_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode != Keys.ShiftKey && e.KeyCode != Keys.Menu && e.KeyCode != Keys.ControlKey)
{
if (e.KeyCode != Keys.Escape)
{
switch (button)
{
case 1:
Program.settings["ShowOverlay_Key"] = ((int)e.KeyCode).ToString();
break;
case 2:
Program.settings["HideOverlay_Key"] = ((int)e.KeyCode).ToString();
break;
case 3:
Program.settings["CompareOverlay_Key"] = ((int)e.KeyCode).ToString();
break;
}
if (Owner != null)
{
((MainForm)Owner).ChangePressKeyData(e.KeyCode);
}
}
this.Close();
}
}
}
}