-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (29 loc) · 743 Bytes
/
main.cpp
File metadata and controls
33 lines (29 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <Windows.h>
#include <fstream>
using namespace std;
int main()
{
ofstream plik;
plik.open("C:\\User\\Desktop\\output.txt"); // path for output file
while (1)
{
POINT cursorPos;
GetCursorPos(&cursorPos);
float x = 0;
x = cursorPos.x;
float y = 0;
y = cursorPos.y;
if ((GetKeyState(VK_RETURN) & 0x8000) != 0) // click ENTER button to save X and Y
{
cout << "X: "<< x << " || Y: " << y << endl;
plik << x << " " << y << endl;
Sleep(100);
}
Sleep(100);
if (GetKeyState(VK_F5)) { // F5 shuts down the program
plik.close();
return 0;
}
}
}