4个回答
展开全部
把人家程序混在一起改编
#include<iostream>
#include<conio.h>
#include<windows.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
int main(){
system("mode con cols=23 lines=14");//控制大小 ,大小不合适可以自己调
char a;
POINT p;
int now=0;
double n=1.5;
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
while(1){
if(KEY_DOWN('L')){
now=0;
Sleep(100);
}
if(KEY_DOWN('O')){
now=1;
Sleep(100);
}
if(KEY_DOWN('P')){
now=2;
Sleep(100);
}
if(KEY_DOWN('N')){
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('M')){
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('Y')){
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('I')){
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('U')){
GetCursorPos(&p);
SetCursorPos(p.x,p.y-n);
Sleep(10);
}
if(KEY_DOWN('J')){
GetCursorPos(&p);
SetCursorPos(p.x,p.y+n);
Sleep(10);
}
if(KEY_DOWN('H')){
GetCursorPos(&p);
SetCursorPos(p.x-n,p.y);
Sleep(10);
}
if(KEY_DOWN('K')){
GetCursorPos(&p);
SetCursorPos(p.x+n,p.y);
Sleep(10);
}
if(now==1){
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(10);
}
if(now==2){
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('G')){
if(n<35.0) n=n+0.5;
system("cls");
if(n<=9){
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
else if(n==9.5){
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
else{
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
}
if(KEY_DOWN('B')){
if(n>1.0) n=n-0.5;
system("cls");
if(n<=9){
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
else if(n==9.5){
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
else{
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
}
}
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(){
system("mode con cols=23 lines=14");//控制大小 ,大小不合适可以自己调
char a;
POINT p;
int now=0;
double n=1.5;
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
while(1){
if(KEY_DOWN('L')){
now=0;
Sleep(100);
}
if(KEY_DOWN('O')){
now=1;
Sleep(100);
}
if(KEY_DOWN('P')){
now=2;
Sleep(100);
}
if(KEY_DOWN('N')){
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('M')){
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('Y')){
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('I')){
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('U')){
GetCursorPos(&p);
SetCursorPos(p.x,p.y-n);
Sleep(10);
}
if(KEY_DOWN('J')){
GetCursorPos(&p);
SetCursorPos(p.x,p.y+n);
Sleep(10);
}
if(KEY_DOWN('H')){
GetCursorPos(&p);
SetCursorPos(p.x-n,p.y);
Sleep(10);
}
if(KEY_DOWN('K')){
GetCursorPos(&p);
SetCursorPos(p.x+n,p.y);
Sleep(10);
}
if(now==1){
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
Sleep(10);
}
if(now==2){
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);
Sleep(10);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
Sleep(10);
}
if(KEY_DOWN('G')){
if(n<35.0) n=n+0.5;
system("cls");
if(n<=9){
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
else if(n==9.5){
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
else{
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
}
if(KEY_DOWN('B')){
if(n>1.0) n=n-0.5;
system("cls");
if(n<=9){
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
else if(n==9.5){
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
else{
cout<<"------鼠标模拟器------"<<endl;
cout<<"| 提示:大小写都可以 |"<<endl;
cout<<"|按N长按 按M停止长按|"<<endl;
cout<<"| 按G增加鼠标速度 |"<<endl;
cout<<"| 按B减少鼠标速度 |"<<endl;
cout<<"|按Y开始普通左键点击 |"<<endl;
cout<<"|按I开始普通右键点击 |"<<endl;
cout<<"|按O开始连续左键点击 |"<<endl;
cout<<"|按P开始连续右键点击 |"<<endl;
cout<<"| 按L停止连续点击 |"<<endl;
cout<<"| 鼠标移动按UHJK |"<<endl;
cout<<"| 目前鼠标速度:";
printf("%.1lf",n);
cout<<" |"<<endl;
cout<<"|____________________|"<<endl;
Sleep(300);
}
}
}
return 0;
}
展开全部
用两个API函数就行了:
SetCursorPos(x, y); // 这里是屏幕坐标
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
SetCursorPos(x, y); // 这里是屏幕坐标
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个要用win的api.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询