代码拉取完成,页面将自动刷新
同步操作将从 charlieshu/Algorithms 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#include <iostream>
#include <Windows.h>
using namespace std;
void Mouse_Move(int x, int y) {
double fScreenWidth = ::GetSystemMetrics(SM_CXSCREEN) - 1;
double fScreenHeight = ::GetSystemMetrics(SM_CYSCREEN) - 1;
double fx = x * (65535.0f / fScreenWidth);
double fy = y * (65535.0f / fScreenHeight);
mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE, fx, fy, 0, 0);
return;
}
void Mouse_left_click() {
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
return;
}
void Mouse_right_click() {
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
return;
}
void Mouse_left_down() {
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
return;
}
void Mouse_left_up() {
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
return;
}
void Mouse_right_down() {
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
return;
}
void Mouse_right_up() {
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
return;
}
void Mouse_middle_down() {
mouse_event(MOUSEEVENTF_MIDDLEDOWN,0,0,0,0);
return;
}
void Mouse_middle_up() {
mouse_event(MOUSEEVENTF_MIDDLEUP,0,0,0,0);
return;
}
int main() {
int x,y;
cout<<"please input moving-number:\n";
cin>>x;
POINT p;
while(p.x < x) {
::GetCursorPos(&p);
Mouse_Move(p.x+1, (p.x-250)*(p.x-250)*0.002);
Sleep(100);
}
return 0;
}
//#include<iostream>
//#include<conio.h>
//#include<windows.h>
//
//#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0) //必要的,我是背下来的
//
//using namespace std;
//
//int main(){
// char a;
// int now=0;
// printf("按Q开始左键点击\n");
// printf("按W开始右键点击\n");
// printf("按空格停止点击\n");
// while(1){
// if(KEY_DOWN(VK_SPACE)){//VK_SPACE 是空格的虚拟键值
// now=0;
// Sleep(100);//你的手不会再一瞬间送开,所以要处理一下
// }
// if(KEY_DOWN('Q')){
// now=1;
// Sleep(100);
// }
// if(KEY_DOWN('W')){
// now=2;
// Sleep(100);
// }
// if(now==1){//模拟点击左键
// mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
// Sleep(10);//要留给某些应用的反应时间
// mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
// }
// if(now==2){//模拟点击右键
// mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
// Sleep(10);
// mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
// }
//
// Sleep(20);//点击间隔 单位是毫秒
// }
//}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。