SHARE
TWEET

Untitled

a guest Apr 25th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Windows.h>
  2. #include <fstream>
  3. #include <iostream>
  4. #include <string>
  5.  
  6.  
  7. using namespace std;
  8.  
  9.  
  10. int main()
  11. {
  12.  
  13.     POINT p;
  14.     fstream file("a.txt", std::ios::out | std::ios::trunc);
  15.  
  16.     while (true) {
  17.         if (GetAsyncKeyState(VK_LBUTTON)) {
  18.             if (GetCursorPos(&p)) {
  19.                 file << p.x << "\n" << p.y << "\n";
  20.  
  21.                 file << p.x << "   " << p.y << endl;
  22.                 if (GetAsyncKeyState(VK_LBUTTON)) {
  23.                     cout << "LPM" << endl;
  24.                     file << "LPM" << endl;
  25.                     break;
  26.                 }
  27.  
  28.                 if (GetAsyncKeyState(VK_RBUTTON)) {
  29.                     cout << "PPM" << endl;
  30.                     file << "PPM" << endl;
  31.                     break;
  32.                 }
  33.  
  34.                 if (GetAsyncKeyState(VK_MBUTTON)) {
  35.                     cout << "SCROLL" << endl;
  36.                     file << "SCROLL" << endl;
  37.                     break;
  38.                 }
  39.             }
  40.  
  41.         }
  42.  
  43.     /*  COORD c;
  44.         std::string x, y;
  45.         file.open("file", std::ios::in);
  46.         while (file >> x) {
  47.             file >> y;
  48.  
  49.             SetCursorPos(std::stoi(x), std::stoi(y));
  50.             Sleep(1000);
  51.         }*/
  52.         system("pause");
  53.         return 0;
  54.  
  55.  
  56.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top