I have a problem while I try to prevent a cursor from changing.
I try to put an overlay view over entire window, but, if under that overlay exist an NSTextView, this will force cursor to change. I want to prevent that, and keep the arrow cursor until my overlay view will be removed.
Overriding the cursorUpdate method does not work:
override func cursorUpdate(with event: NSEvent) {
return
}
Thanks!
Even this question answer does not help. This solution is valid only if the overlay view is smaller than TextView.

If the
NSTextViewis yours, you can get the behaviour you want by subclassing and overridingmouseMoved:there. There are several examples available, if you search.If subclassing the text view is not an option, the best thing would be to use an
NSWindowfor your overlay.NSWindowStyleMaskBorderlessstyle mask.addChildWindow:orderedto position your overlayThis answer explains it quite well.
Something like this:
Now you can add your overlay view as the window's
contentView. The cursor will not change in response to the views below.See also.