From 392df9bae3de8a71bf1d119a58dc2d9f1388751d Mon Sep 17 00:00:00 2001 From: paradust7 <102263465+paradust7@users.noreply.github.com> Date: Mon, 6 Jun 2022 03:05:07 +0000 Subject: [PATCH] Use CGWarpMouseCursorPosition --- source/Irrlicht/CIrrDeviceOSX.mm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/Irrlicht/CIrrDeviceOSX.mm b/source/Irrlicht/CIrrDeviceOSX.mm index eb3f8163..16236e04 100644 --- a/source/Irrlicht/CIrrDeviceOSX.mm +++ b/source/Irrlicht/CIrrDeviceOSX.mm @@ -1172,9 +1172,8 @@ void CIrrDeviceMacOSX::setMouseLocation(int x,int y) c.x = p.x; c.y = p.y; - CGEventRef ev = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, c, kCGMouseButtonLeft); - CGEventPost(kCGHIDEventTap, ev); - CFRelease(ev); + CGWarpMouseCursorPosition(c); + CGAssociateMouseAndMouseCursorPosition(YES); }