以下是一段超级坑爹的代码(一定有效)
#include<windows.h>
#include<ctime>
using namespace std;
#define kd(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
int main()
{
int x=GetSystemMetrics(SM_CXSCREEN);
int y=GetSystemMetrics(SM_CYSCREEN);
srand(time(NULL));
while(1)
{
SetCursorPos(rand()%x,rand()%y);
if(kd(VK_RETURN)) break;
}
return 0;
}
记得点赞关注加评论哦!