Snippet
#include <iostream.h>
#include <windows.h>
using namespace std;
int main ()
{
int n = 1;
int x; // Mouse coordinates needed for mouse_event()
int y; // Mouse coordinates needed for mouse_event()
cout<<"Press numpad 0 to double click\nPress numpad 1 to stop";
while (n != NULL)
{
if(GetAsyncKeyState(VK_NUMPAD0)) //Key to press in order to click
{
mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); //Click Down
mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); //Click Up
}
if(GetAsyncKeyState(VK_NUMPAD1)) // Key that shuts program down
break;
}
return 0;
}
Copy & Paste
|