Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //made this program to autoclick when I have the 5th mouse button(the button on the side of my mouse) held down.
- #include <iostream>
- #include <windows.h>
- using namespace std;
- int main(int argc, char * argv[])
- {
- int delay;
- int running = 1;
- cout << "Program made by: Basil Kanaan" << endl;
- cout << " " << endl;
- cout << "Time interval in Miliseconds?" << endl;
- cout << "(MS): ";
- cin >> delay;
- cout << "Program started." << endl;
- do
- {
- //VK_XBUTTON2 is my 5th mouse button.
- while (GetAsyncKeyState(VK_XBUTTON2) == false);
- {
- int x = 0, y = 0;
- mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0);
- mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0);
- Sleep(delay);
- }
- //when you hit the "End" button then the 5th mouse button, the program exits.
- } while (GetAsyncKeyState(VK_END) == false);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement