Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to end editing in NSTextFieldCell inside NSOutlineView after ESC key is pressed

I'm trying to get a custom NSTextFieldCell (inside a NSOutlineView) to end editing when the ESC key is pressed but cannot find any way to accomplish this. I tried to add an observer for the NSControlTextDidChangeNotification-notification but it is not fired for the ESC-key nor is keyDown fired in the NSOutlineView.

like image 519
finnsson Avatar asked Apr 30 '11 10:04

finnsson


1 Answers

Esc triggers -cancelOperation in NSResponder. You can try to handle this somewhere in your responder chain.

like image 66
Frederik Slijkerman Avatar answered Oct 14 '22 06:10

Frederik Slijkerman