Global Mouse Moved Events in Cocoa

前端 未结 3 1685
感动是毒
感动是毒 2020-12-25 09:55

Is there a way to register for global mouse moved events in Cocoa? I was able to register for the events using Carbon\'s InstallEventHandler(), but would prefer

3条回答
  •  再見小時候
    2020-12-25 10:07

    If you want to track the mouse no matter where it is, you want a CGEventTap. There is no Cocoa equivalent. If you just want to track it in your application then you should explain why you're finding yourself unable to do so a little more thoroughly.

提交回复
热议问题