Swift macOS MouseMove

I have a Swift project with a NSWindow with an NSVIew in the center
each has a MouseMove event connect to it

However the event SHOULD fire for which ever object the mouse is over (View or Window) but doesn’t, unless the object is CLICK on first. So for MouseDrag this is ok, since you have to click for that event anyways, but not mouseMove.

Any ideas?

did finally fix it… but went thru so many “Hail Mary” attempts I’m not sure what actually did the trick.

I did have to add “acceptsMouseMoves” to the MouseEnter/Exit of NSView amongs a few other tweaks.

2 Likes

That sounds about right. It’s funny coming from Xojo as they do quite a bit of setting up for you. It’s just a shame that can’t be smarter about it.

well that kind of works…

NSView on NSWINDOW, I can limit mousemove to the view if the mouse is inside it

but go to next level

NSBUTTON → NSVIEW → NSWINDOW a mouse move on the Button appears on BOTH button and View

expanding on MouseEnter/Exit means I may have to manaage an entire heiarchy of contols which seems AppKit should already do