mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-05-28 21:13:55 +00:00
Update: add CFRelease source
This commit is contained in:
parent
5c2864485d
commit
02c668a946
@ -189,6 +189,7 @@ void toggleKeyCode(MMKeyCode code, const bool down, MMKeyFlags flags, uintptr pi
|
||||
}
|
||||
|
||||
SendTo(pid, keyEvent);
|
||||
CFRelease(source);
|
||||
}
|
||||
#elif defined(IS_WINDOWS)
|
||||
const DWORD dwFlags = down ? 0 : KEYEVENTF_KEYUP;
|
||||
@ -284,6 +285,7 @@ void toggleKey(char c, const bool down, MMKeyFlags flags, uintptr pid) {
|
||||
CGEventKeyboardSetUnicodeString(keyEvent, 1, &ch);
|
||||
|
||||
SendTo(pid, keyEvent);
|
||||
CFRelease(source);
|
||||
}
|
||||
#else
|
||||
#define toggleUniKey(c, down) toggleKey(c, down, MOD_NONE, 0)
|
||||
|
@ -91,6 +91,7 @@ void moveMouse(MMPointInt32 point){
|
||||
|
||||
CGEventPost(kCGHIDEventTap, move);
|
||||
CFRelease(move);
|
||||
CFRelease(source);
|
||||
#elif defined(USE_X11)
|
||||
Display *display = XGetMainDisplay();
|
||||
XWarpPointer(display, None, DefaultRootWindow(display), 0, 0, 0, 0, point.x, point.y);
|
||||
@ -112,6 +113,7 @@ void dragMouse(MMPointInt32 point, const MMMouseButton button){
|
||||
|
||||
CGEventPost(kCGHIDEventTap, drag);
|
||||
CFRelease(drag);
|
||||
CFRelease(source);
|
||||
#else
|
||||
moveMouse(point);
|
||||
#endif
|
||||
@ -152,6 +154,7 @@ void toggleMouse(bool down, MMMouseButton button) {
|
||||
|
||||
CGEventPost(kCGHIDEventTap, event);
|
||||
CFRelease(event);
|
||||
CFRelease(source);
|
||||
#elif defined(USE_X11)
|
||||
Display *display = XGetMainDisplay();
|
||||
XTestFakeButtonEvent(display, button, down ? True : False, CurrentTime);
|
||||
|
Loading…
Reference in New Issue
Block a user