-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcore.cpp
62 lines (54 loc) · 1.38 KB
/
core.cpp
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
#include "headers\\input_module.h"
#include "headers\\tree.h"
#include "headers\\output_module.h"
#include "headers\\self.h"
#include<cctype>
map<string, wstring> iolist = iostrings();
node* N0 = map_create(iolist);
node* node_now = N0;
bool self_inp = false;
int Track(int key_stroke)
{
key_stroke = tolower(key_stroke);
if (self_inp == false)
{
key_stroke = tolower(key_stroke);
if (key_stroke != tolower(VK_INSERT) && !isalnum(key_stroke))
{
node_now = N0;
}
else if (node_now == NULL && !isalnum(key_stroke))
{
node_now = N0;
}
else if (key_stroke == tolower(VK_INSERT) && node_now->_str.length() > 0)
{
self_inp = true;
SendFormattedOutput(node_now->_str, node_now->_depth, true);
self_inp = false;
}
else if (node_now != NULL && isalnum(key_stroke))
{
if (node_now->_dir[char(key_stroke)] == NULL)
{
node_now->_dir.erase(char(key_stroke));
node_now = NULL;
}
else
{
node_now = node_now->_dir[char(key_stroke)];
}
}
}
return 0;
}
int main()
{
// set the hook
SetHook();
// loop to keep the console application running.
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
}
}