#include <windows.h>
#include <iostream>
#pragma comment(lib,"User32.lib")
using namespace std;
static bool g_Active = false;
DWORD WINAPI proizv(PVOID Parametr)
{
while (true)
{
if (GetAsyncKeyState(81) == -32768)
{
while (GetAsyncKeyState(81))
{
}
g_Active = true;
}
Sleep(20);
}
return 0;
}
void main()
{
DWORD idThread, dwThrdParam = 1;
HANDLE h1;
h1 = CreateThread(NULL, 0, proizv, &dwThrdParam, 0, &idThread);
while (true)
{
if (g_Active == true)
{
cout << "1337" << endl;
g_Active = false;
}
else
{
cout << "false ebalo" << endl;
}
}
}