#include <iostream>
#include <windows.h>
#include <stdlib.h>
using namespace std;
void GetMousePos()
{
POINT point;
GetCursorPos(&point);
cout<<"X:"<<point.x<<"/tY:"<<point.y<<endl<<endl;
};
void MoveMouse()
{
cout<<"请输入鼠标新坐标:"<<endl;
int a,b;
cout<<"x坐标:";
cin>>a;
cout<<"y坐标:";
cin>>b;
SetCursorPos(a,b);
cout<<endl<<endl;
};
void keyboard()
{
char keych;
cout<<"CTRL-A:屏幕显示AAAA"<<endl;
cout<<"CTRL-B:屏幕显示BBBB"<<endl;
cout<<"CTRL-C:屏幕显示CCCC"<<endl;
cout<<"CTRL-D:屏幕显示DDDD"<<endl;
cin>>keych;
switch(keych)
{
case 01: cout<<"/nAAAA/n/n";break;
case 02: cout<<"/nBBBB/n/n";break;
case 03: cout<<"/nCCCC/n/n";break;
case 04: cout<<"/nDDDD/n/n";break;
default: exit(1);break;
}
}
void main(){
int i;
A:cout<<"/t##################/n"<<endl;
B:cout<<"1.键盘组合键演示"<<endl<<"2.鼠标击右键清屏"<<endl<<
"3.获取鼠标当前屏幕位置"<<endl<<"4.改变鼠标所在位置"<<endl;
cin>>i;
switch(i){
case 1:keyboard();goto B;break;
case 2:while(1)
{
if(GetKeyState(VK_RBUTTON)<0)
{
system("cls");break;
}
}
goto A;
case 3:GetMousePos();goto B;break;
case 4:MoveMouse();goto B;break;
}
}