Three mouse event methods were not discussed in Chapter 18: mouseMoved(_:), mouseEntered(_:), and mouseExited(_:).
To receive mouseMoved(_:),
the view’s window needs to accept mouse moved events.
If it does, the mouseMoved(_:) message
is sent to the window’s first responder.
To set the window to get mouse moved events,
set the acceptsMouseMovedEvents property
window?.acceptsMouseMovedEvents = true
At this point, the view will be sent the message every time the mouse moves. This is a lot of events. When people ask about mouse moved events, we ask them why they want it. They usually say, “Uh, rollovers.”
Rollovers are very popular with hyperlinks. As ...