你好,我是一名新手,想知道如何为系统级事件(例如鼠标拖动)创建一个监听器。我已将以下内容添加到我的应用程序中(我在另一篇帖子上看到的):
static CGEventRef eventFunction(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
{
printf("event triggered\n");
return event;
}
但它从未被调用,我不确定应该在何处注册回调函数。