Skip to content

Commit 6aadc5a

Browse files
Add Helper Methods for calculating the required absolute position on the screen
1 parent 0f88d28 commit 6aadc5a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/win32/mouse.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
: ((button) == RIGHT_BUTTON ? MOUSEEVENTF_RIGHTDOWN \
2121
: MOUSEEVENTF_MIDDLEDOWN))
2222

23+
int CalculateAbsoluteCoordinateX(int x)
24+
{
25+
MMSize displaySize = getMainDisplaySize();
26+
return (x * 65536) / displaySize.width;
27+
}
28+
29+
int CalculateAbsoluteCoordinateY(int y)
30+
{
31+
MMSize displaySize = getMainDisplaySize();
32+
return (y * 65536) / displaySize.height;
33+
}
34+
2335
/**
2436
* Move the mouse to a specific point.
2537
* @param point The coordinates to move the mouse to (x, y).

0 commit comments

Comments
 (0)