Pergunta

I'm using a view in a background window that I would like to click and immediately activate a mouseDown event, I currently have to click once for the view's window to activate and click again to run mouseDown. I remember having seen something like this but I haven't used XCode in almost a year and I can't find it anywhere.

Thanks for the help.

Foi útil?

Solução

Found it!

In case anyone runs into this problem all you need to do is override acceptsFirstMouse:

In your view class just add the method:

- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent {
return YES;
}

Super simple stuff.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top