Skip navigation.
 
mlRe: Problems with mouse events
FROM : Ryan Stevens
DATE : Sun Nov 21 20:14:07 2004

On Nov 20, 2004, at 7:23 PM, Sam Wilkins wrote:

> I was hoping one of you could answer a few questions I have.
>

[snip]
>
> Some guy who didn't want to respond to the list because he didn't want
> spammers getting his email found this code for me. Unfortunately, the
> NSScrollView in which this view resides has stopped receiving
> scrollWheel events. I cannot figure out where to insert myself into
> the responder chain so that selected text fields get key events, my
> scroll view gets scrollWheel events (the only thing I can think of to
> do causes an instant crash whenever keyDown is generated (with over
> 10,000 recursive calls to -[NSViewRectCache cacheRect:] on the
> stack!), which also includes holding shift to modify scroll wheel
> behaviour) and my view gets every other mouse related event.
>


There was a discussion on CocoaDev dealing with scrollWheel events that
may help and should be pretty easy to find.

> My next problem is that often the mouse is already inside the rect
> when the window is first displayed. Do you have any suggestions for
> forcing a mouseEntered event to be generated if that's the case?
>


Could just do it yourself (in applicationDidFinishLaunching perhaps)...

if (NSPointInRect(mouseLoc, theRect)) {/* create and send off a
mouseEntered event */ }

Related mailsAuthorDate
mlProblems with mouse events Sam Wilkins Nov 21, 04:23
mlRe: Problems with mouse events Ryan Stevens Nov 21, 20:14
mlRe: Problems with mouse events Sam Wilkins Nov 23, 05:54