-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindowEvent.cs
More file actions
105 lines (79 loc) · 1.78 KB
/
WindowEvent.cs
File metadata and controls
105 lines (79 loc) · 1.78 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
using SFML.Graphics;
using SFML.Window;
using static Midnite;
public class WindowEvent
{
private List<Keyboard.Key> pressedKeys = [];
private List<Keyboard.Key> releasedKeys = [];
public List<Keyboard.Key> PressedKeys
{
get
{
return pressedKeys;
}
}
public List<Keyboard.Key> ReleasedKeys
{
get
{
return releasedKeys;
}
}
string typedText = "";
public string TypedText
{
get
{
return typedText;
}
}
public void ClearTypedText()
{
typedText = "";
}
public void ClearKeys()
{
releasedKeys.Clear();
pressedKeys.Clear();
}
public void Closed(object sender, EventArgs e)
{
((WindowBase)sender).Close();
}
public void KeyReleased(object sender, KeyEventArgs e)
{
Keyboard.Key key = e.Code;
}
public void Resized(object sender, SizeEventArgs e)
{
FloatRect visible = new(0, 0, e.Width, e.Height);
((RenderWindow)sender).SetView(new(visible));
}
public void TextEntered(object sender, TextEventArgs e)
{
typedText += e.Unicode;
}
public void KeyPressed(object sender, KeyEventArgs e)
{
Keyboard.Key key = e.Code;
pressedKeys.Add(key);
}
public void FocusLost(object sender, EventArgs e)
{
}
public void FocusGained(object sender, EventArgs e)
{
}
public void MouseEntered(object sender, EventArgs e)
{
}
public void MouseLeft(object sender, EventArgs e)
{
}
public void MouseButtonPressed(object sender, MouseButtonEventArgs e)
{
}
public void MouseButtonReleased(object sender, MouseButtonEventArgs e)
{
}
}