#pragma comment(lib, "user32")
#include <iostream>
#include <Windows.h>
bool isDownLeft() {
if ((GetKeyState(VK_XBUTTON2) & 0x8000))
return true;
else
return false;
}
bool isDownRight() {
if ((GetKeyState(VK_XBUTTON1) & 0x8000))
return true;
else
return false;
}
int main() {
while (true) {
if (isDownLeft()) {
mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, 0, 0);
Sleep(57);
}
if (isDownRight()) {
mouse_event(MOUSEEVENTF_RIGHTDOWN, NULL, NULL, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, NULL, NULL, 0, 0);
Sleep(37);
}
Sleep(1);
}
return 0;
}