chrisgoyal
chrisgoyal

Reputation: 4347

Responder chains for nil-targeted actions and events

Do events (i.e. -keyDown: and -keyUp:) follow the same responder chain as nil-targeted actions?

Thanks.

Upvotes: 3

Views: 533

Answers (1)

Pat McGee
Pat McGee

Reputation: 458

Similar, but not the same. See the Apple Conceptual Guide on Event Architecture at http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html, especially the section "The Responder Chains"

In this section are two subsections, "Responder Chain For Event Messages" and "Responder Chain for Action Messages" that detail the two chains and the differences between them. There are too many differences to detail, but some include: 1) The responder chain for action messages includes both the key window and the main window when both are present. The responder chain for key events includes only the key window. 2) For event messages, the last things in the chain are NSWindow and a NSWindowController if present. For action messages, the last thing is NSApp and its delegate.

Upvotes: 2

Related Questions