README.md

December 4, 2022 ยท View on GitHub

Heavy Mouse

Description

Moves the mouse cursor down your screen and prints the coordinates.

More Info

Submitted On
Bymichael coder
LevelBeginner
User Rating4.0 (24 globes from 6 users)
CompatibilityC++ (general), Microsoft Visual C++, Borland C++
CategorySystem Services/ Functions
WorldC / C++
Archive File

API Declarations

#include <iostream>
#include <windows.h>
using namespace std;

Source Code

#include <iostream>
#include <windows.h>
using namespace std;
int main(){
	bool on=false;
	cout<<"Heavy Mouse by mike\nTo exit press F11\n";
	Sleep(4000);
	while (1){
		Sleep(1);
		POINT pos;
		GetCursorPos(&pos);
		int x=pos.x;
		int y=pos.y;
		Sleep(10);
		SetCursorPos(x,y+1);
		if(GetAsyncKeyState(VK_F11)<0){
			break;
		}
		cout<<"x="<<x<<" y="<<y<<"\n";
	}
	return 1;
}