Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
1,048
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. //made this program to autoclick when I have the 5th mouse button(the button on the side of my mouse) held down.
  2.  
  3. #include <iostream>
  4. #include <windows.h>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main(int argc, char * argv[])
  10.  
  11. {
  12.     int delay;
  13.     int running = 1;
  14.  
  15.     cout << "Program made by: Basil Kanaan" << endl;
  16.     cout << "     " << endl;
  17.     cout << "Time interval in Miliseconds?" << endl;
  18.     cout << "(MS): ";
  19.     cin >> delay;
  20.  
  21.  
  22.     cout << "Program started." << endl;
  23.  
  24.  
  25.     do
  26.     {
  27.  
  28. //VK_XBUTTON2 is my 5th mouse button.
  29.         while (GetAsyncKeyState(VK_XBUTTON2) == false);
  30.         {
  31.             int x = 0, y = 0;
  32.  
  33.             mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
  34.             mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
  35.             Sleep(delay);
  36.  
  37.  
  38.  
  39.         }
  40. //when you hit the "End" button then the 5th mouse button, the program exits.
  41.     } while (GetAsyncKeyState(VK_END) == false);
  42.     return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement