用法:
Lshift+LTab(长按)启动
LCtrl+LAlt锁定/解锁
LAlt+向上/向下以改变速度
LAlt+左/右切换鼠标左键和右键
鼠标连点的最大频率不会超过屏幕刷新率,请放心食用。
仅在Windows下运行!
#include <bits/stdc++.h>
#include <Windows.h>
#include <conio.h>
#define KEY_DOWN(key) (GetAsyncKeyState(key)&&0x8000)
#define wait(b) while(!(b));
LARGE_INTEGER t1,t2,tc;
using namespace std;
char mouse='L';
long double speed=10;
POINT d;
bool XX=true;
void fun(int x,int y,bool t);
void start();
long double end();
void click(char lr)
{
start();
if(lr=='L'){
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
fun(d.x,d.y,XX);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
}
else {
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
fun(d.x,d.y,XX);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
}
while(end()<(1/speed));
}
void fun(int x,int y,bool t)
{
mouse_event(MOUSEEVENTF_MIDDLEUP,0,0,0,0);
if(t)SetCursorPos(x,y);
}
void print()
{
system("cls");
cout<<(mouse=='L'?"mouse-LeftKey":"mouse-RightKey")<<endl;
cout<<setprecision(16)<<speed<<"times/s"<<endl;
cout<<(XX?"Lock-mouse":"unLock-mouse")<<endl;
cout<<endl<<"Lshift+LTab(long press) to start"<<endl;
cout<<"LCtrl+LAlt to lock/unlock"<<endl;
cout<<"LAlt+UP/DOWN to change the speed"<<endl;
cout<<"LAlt+LEFT/RIGHT to switch left and right mouse buttons"<<endl;
}
void start()
{
QueryPerformanceFrequency(&tc);
QueryPerformanceCounter(&t1);
}
long double end()
{
QueryPerformanceCounter(&t2);
return (long double)(t2.QuadPart-t1.QuadPart)/(long double)tc.QuadPart;
}
int main()
{
std::ios::sync_with_stdio(false);
DEVMODE dm;
dm.dmSize = sizeof(DEVMODE);
::EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm);
int nDisplayFrequency = dm.dmDisplayFrequency;
speed=nDisplayFrequency/2.0;
GetCursorPos(&d);
start();
print();
while(true){
while(KEY_DOWN(VK_LSHIFT)&&KEY_DOWN(VK_TAB)){
click(mouse);
fun(d.x,d.y,XX);
if(KEY_DOWN(VK_LCONTROL)&&KEY_DOWN(VK_LMENU)){
GetCursorPos(&d);XX=!XX;
while(!(KEY_DOWN(VK_LCONTROL)&&KEY_DOWN(VK_LMENU)))
{
GetCursorPos(&d);
click(mouse);
}
}
}
GetCursorPos(&d);
if(KEY_DOWN(VK_LCONTROL)&&KEY_DOWN(VK_LMENU)){
XX=!XX;
print();
wait(!(KEY_DOWN(VK_LCONTROL)&&KEY_DOWN(VK_LMENU)));
}
if(KEY_DOWN(VK_LMENU)){
if(KEY_DOWN(VK_LEFT)){
mouse='L';
print();
}
else if(KEY_DOWN(VK_RIGHT)){
mouse='R';
print();
}
if(KEY_DOWN(VK_UP)){
GetCursorPos(&d);speed++;
if(speed>nDisplayFrequency) speed=nDisplayFrequency;
print();
while(KEY_DOWN(VK_UP)){
GetCursorPos(&d);
}
}
if(KEY_DOWN(VK_DOWN)){
GetCursorPos(&d);speed--;
if(speed<1) speed=1;
print();
while(KEY_DOWN(VK_DOWN)){
GetCursorPos(&d);
}
}
}
}
return 0;
}
这是一款专为Windows设计的鼠标连点器,通过Lshift+LTab启动,使用LCtrl+LAlt进行锁定/解锁,利用LAlt+上下调整速度,左右键切换。最大频率不超过屏幕刷新率,安全无忧。
327

被折叠的 条评论
为什么被折叠?



