连点器备份
#include<Windows.h>
#include<iostream>
using namespace std;
int main(){
cout<<"What do you want?\n0--------Press the Ctrl+V.\n1--------Let the code to be a mouse.\n";
bool a;
cin>>a;
if(!a){
cout<<"I see.\nI will press the Ctrl+V,and I will sleep a few microsecends.";
cout<<"\nNow press my sleep time.(ms)\n";
int time;
cin>>time;
cout<<"I see,I will press "<<1000.0/time<<" \"Ctrl+V\"s in one secend.\nIf you press the ESC,I will sleep until another ESC.\n";
bool openorclose=true;
while(1){
if(openorclose){
Sleep(time);
keybd_event(VK_CONTROL, 0, 0, 0);
keybd_event(byte('V'), 0, 0, 0);
keybd_event(byte('V'), 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
}if(GetAsyncKeyState(VK_ESCAPE)){
openorclose=!openorclose;
while(GetAsyncKeyState(VK_ESCAPE)){
}
}
}
}else{
cout<<"I see.\nI will be a mouse,and I will sleep a few microsecends.";
cout<<"\nNow press my sleep time.\n";
int time;
cin>>time;
cout<<"I see,I will press "<<1000.0/time<<" the left of the mouse in one secend.\nIf you press the ESC,I will sleep until another ESC.\n";
bool openorclose=true;
while(1){
if(openorclose){
Sleep(time);
mouse_event(MOUSEEVENTF_LEFTDOWN|MOUSEEVENTF_LEFTUP,0,0,0,0);
}if(GetAsyncKeyState(VK_ESCAPE)){
openorclose=!openorclose;
while(GetAsyncKeyState(VK_ESCAPE)){
}
}
}
}
}