Skip to content

Commit 3ad9110

Browse files
committed
(#12) Swiched to using SendInput instead of deprecated mouse_event function
1 parent eb81508 commit 3ad9110

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: src/mouse.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,14 @@ void toggleMouse(bool down, MMMouseButton button)
201201
XTestFakeButtonEvent(display, button, down ? True : False, CurrentTime);
202202
XSync(display, false);
203203
#elif defined(IS_WINDOWS)
204-
mouse_event(MMMouseToMEventF(down, button), 0, 0, 0, 0);
204+
INPUT mouseInput;
205+
mouseInput.type = INPUT_MOUSE;
206+
mouseInput.mi.mouseData = 0;
207+
mouseInput.mi.dx = 0;
208+
mouseInput.mi.dy = 0;
209+
mouseInput.mi.time = 0;
210+
mouseInput.mi.dwFlags = MMMouseToMEventF(down, button);
211+
SendInput(1, &mouseInput, sizeof(mouseInput));
205212
#endif
206213
}
207214

0 commit comments

Comments
 (0)