4
嗨,我是新的可可編程,並想知道如何創建系統範圍事件(如鼠標拖動)的偵聽器。我把這個添加到我的應用程序(我看到了它的另一篇文章):OSX /可可:聽全系統鼠標拖動事件
static CGEventRef eventFunction(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
{
printf("event triggered\n");
return event;
}
但它永遠不會被調用和IM不知道在哪裏,我打算註冊一個回調。