-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyButton.pde
More file actions
57 lines (57 loc) · 1.01 KB
/
KeyButton.pde
File metadata and controls
57 lines (57 loc) · 1.01 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
Key[] masKey;
class Key
{
char symbole;
boolean push;
boolean last;
Key(char Dsymbole)
{
push = false;
last = false;
symbole = Dsymbole;
}
boolean handle()
{
boolean flag;
if(push != last) flag = true;
else flag = false;
return flag;
}
}
void UpdateLastMasKey()
{
for(Key temp : masKey)
{
temp.last = temp.push;
}
}
void keyPressed()
{
masKey[keyCode].push = true;
if(!UIEventOn("EnabledconsoleWindow"))
switch(keyCode)
{
case 96:
UIEventSwitch("EnabledconsoleWindow");
break;
}
else //Если мы находимся в консоли
{
if(keyCode != 96)
if(keyCode != 10)
{
if(keyCode != 8 && keyCode != 16 && keyCode != 17) commandPromt.Add(key+"");
else commandPromt.Del();
}
else
{
DebudConsoleController(commandPromt.variable);
commandPromt.Clean();
}
else UIEventSwitch("EnabledconsoleWindow");
}
}
void keyReleased()
{
masKey[keyCode].push = false;
}