Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <iostream>
- #include <Windows.h>
- using namespace std;
- int main ()
- {
- int p = 10;
- POINT pos;
- while(1){
- GetCursorPos( & pos );
- if(GetAsyncKeyState(VK_UP))
- {
- SetCursorPos(pos.x, pos.y-p);
- mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0);
- cin.get();
- }
- if(GetAsyncKeyState(VK_DOWN))
- {
- SetCursorPos(pos.x, pos.y+p);
- mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0);
- cin.get();
- }
- if(GetAsyncKeyState(VK_LEFT))
- {
- SetCursorPos(pos.x-p, pos.y);
- mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0);
- cin.get();
- }
- if(GetAsyncKeyState(VK_RIGHT))
- {
- SetCursorPos(pos.x+p, pos.y);
- mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP,0,0,0,0);
- cin.get();
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement