连点器备份

发布于 2023-07-10 17:47:03 来源 : 哔哩哔哩

#include<>


【资料图】

#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 "<</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 "<</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)){

}

}

}

}

}

关键词: