#include <iostream>
#include <fstream>
#include <conio.h>

using namespace std;

int main()
{
	ofstream f;
	char c;
	f.open("C:\\keylog.txt");
	do
	{
			c=getch();
			if(c!=27)
			{
					cout << c;
					f << c;
			}
	} while(c!=27);
	f.close();
    cout << endl;
    return 0;
}


