How to make a transparent NSView subclass handle mouse events?

后端 未结 7 1583
清歌不尽
清歌不尽 2021-02-04 10:31

The problem

I have a transparent NSView on a transparent NSWindow. The view\'s drawRect: method draws some content (NSIma

7条回答
  •  别那么骄傲
    2021-02-04 10:59

    You can use an event monitor to catch events outside a window/view. https://developer.apple.com/library/mac/documentation/cocoa/conceptual/eventoverview/MonitoringEvents/MonitoringEvents.html

提交回复
热议问题