I am working on a Cocoa application with editable text fields. These text fields should take values, but do not need to check spelling or use any other parameters specified in the default context menu. I read that the easiest way to remove the right-click context menu of the mouse / select + click is to override the function:
rightMouseDown:(NSEvent *)
I did this in the regular NSTextfield class. This fix blocks the userβs right-clicking when the text field is enabled and not selected, but as soon as the user double-clicks / enters the text field to edit the default right-click functionality.
Is it because firstResponder switches to a class in the inheritance chain when trying to edit a field? Is this approach the right way to disable all context menu functions for this NSTextField?
Thanks!
source share