Skip to content

Commit 4ebf808

Browse files
Correct Types and Return values
1 parent 097c254 commit 4ebf808

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/win32/mouse.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
: ((button) == RIGHT_BUTTON ? MOUSEEVENTF_RIGHTDOWN \
3030
: MOUSEEVENTF_MIDDLEDOWN))
3131

32-
int CalculateAbsoluteCoordinates(MMPoint point) {
32+
MMPoint CalculateAbsoluteCoordinates(MMPoint point) {
3333
MMSize displaySize = getMainDisplaySize();
34-
return MMPointMake((x / displaySize.width) * ABSOLUTE_COORD_CONST, (y / displaySize.height) * ABSOLUTE_COORD_CONST);
34+
return MMPointMake((point.x / displaySize.width) * ABSOLUTE_COORD_CONST, (point.y / displaySize.height) * ABSOLUTE_COORD_CONST);
3535
}
3636

3737
/**
@@ -40,13 +40,13 @@ int CalculateAbsoluteCoordinates(MMPoint point) {
4040
*/
4141
void moveMouse(MMPoint point) {
4242
INPUT mouseInput;
43-
POINT pointAbsolute = CalculateAbsoluteCoordinates(point);
43+
MMPoint pointAbsolute = CalculateAbsoluteCoordinates(point);
4444
mouseInput.type = INPUT_MOUSE;
4545
mouseInput.mi.dx = pointAbsolute.x;
4646
mouseInput.mi.dy = pointAbsolute.y;
4747
mouseInput.mi.mouseData = 0;
4848
mouseInput.mi.time = 0;
49-
mouseInput.mi.dwFlags = MouseEventFlags.MOUSEEVENTF_MOVE | MouseEventFlags.MOUSEEVENTF_ABSOLUTE;
49+
mouseInput.mi.dwFlags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE;
5050
mouseInput.mi.dwExtraInfo = 0;
5151
SendInput(1, & mouseInput, sizeof(mouseInput));
5252
}

0 commit comments

Comments
 (0)