我浏览了Synergy的源代码以查找生成鼠标事件的调用:
#include <ApplicationServices/ApplicationServices.h>int to(int x, int y){ CGPoint newloc; CGEventRef eventRef; newloc.x = x; newloc.y = y; eventRef = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, newloc, kCGMouseButtonCenter); //Apparently, a bug in xpre requires this next line CGEventSetType(eventRef, kCGEventMouseMoved); CGEventPost(kCGSessionEventTap, eventRef); CFRelease(eventRef); return 0;}现在编写Python绑定!



