I have an NSPanel with about 4 different NSTextField\'s on it. I\'m looking at getting the usual cut, copy, paste, selectAll working for some of the fields.
The best
From the article you linked to:
One interesting thing about this solution is that the handler object does not need to be the target view for actions. You could make a single NSButton perform the copy and paste operations for your whole window, if you'd like. (This is similar to the way that a single menu item can perform copy or paste operations for your whole application.)
The search for a view which wants to handle a key equivalent does not care which view is first responder. It searches the entire view hierarchy. Once it finds the single AXCVHandler
, that object performs the key equivalent. The way it performs it is to send a corresponding action to the responder chain, which does begin at the first responder. So, that one AXCVHandler
object is sufficient to direct the appropriate action to any of your text fields because any of them can be the first responder.