NSResponder is a class used in Mac Development. NSResponder is an abstract class that forms the basis of event and command processing in the Application Kit. The core classes—NSApplication, NSWindow, and NSView—inherit from NSResponder, as must any class that handles events. The responder model is built around three components: event messages, action messages, and the responder chain.
Questions tagged [nsresponder]
106 questions
2
votes
2 answers
secondary click nsresponder, right click doesn't work
I'm trying to get a NSOutlineView to accept secondary clicks, but can't seem to figure it out. I've tried changing secondary clicks from two fingers, to right corner and left corner on the trackpad, and still I don't get any respons in my outline…

Xusermac Oslo
- 45
- 3
2
votes
2 answers
nextKeyView is not working
I have developed an application, which has one tableview and 4 textfields.
When I run the app, the control is not going orderwise by giving TAB. For that I set initialResponder as tableView, then connected tableview's nextKeyView to textfield,…

Preethi
- 371
- 2
- 6
- 20
2
votes
2 answers
Is there a KeyUp: method for flagsChanged:?
I have implemented the - (void)flagsChanged:(NSEvent *)theEvent method in my application. It works fine when I hold down the [alt] key. The method only sends when the key is pressed, but not when I let it go again. The - (void)keyUp:(NSEvent…

Silicone
- 643
- 6
- 19
1
vote
1 answer
How to make an NSControl (e.g., NSTokenField) ignore mouse events
Specifically, I'd like to make an NSTokenField ignore mouse events because I'm using it in a NSTableCellView just to display data in a tokenized way without allowing any editing.
Setting the token field's enabled = NO works, except that it greys out…

yuji
- 16,695
- 4
- 63
- 64
1
vote
1 answer
Is there such thing as NSResponder delegate?
In my Cocoa application on the application menu there is a menu item "Delete", which sends a delete: message to first responder. Now, I have the keyboard focus on a NSOutlineView, which is the first responder in this case. Short of subclassing…

Tony
- 36,591
- 10
- 48
- 83
1
vote
1 answer
WKWebView in Cocoa app can't get the cursor on click
I created a simple test app where one field is an NSTextField and another is a

Clifton Labrum
- 13,053
- 9
- 65
- 128
1
vote
2 answers
NSApplication responder chain for arrow keys
I have an NSTextField in my window and 4 menu items with key equivalents ←↑→↓.
When the text field is selected and I press an arrow key, I would expect the cursor to move in the text field but instead the corresponding menu item action is…

Codey
- 1,131
- 2
- 15
- 34
1
vote
0 answers
How to manage the velocity with my PanResponder?
I'm trying to use the PanGestureHandler api from the react-native-gesture-handler package and especially the move with velocity.
Everything is working well with the panGesture, the properties velocityX & veloctyY exists from the event response and I…

oktapodia
- 1,695
- 1
- 15
- 31
1
vote
3 answers
-makeFirstResponder: usage
I am fairly new to cocoa programming and I would like to ask if anyone can explain me how to
-(BOOL)makeFirstResponder:(NSResponder *)responder; method works. I was planning on using it for NSEvent but can anyone show me how to implement it?
I am…

Muttur
- 31
- 2
- 4
1
vote
1 answer
MouseDragged not released when dragging on other views
I have 2 subclasses of NSView that are subviews to a common superview. They dont overlap and they both intercept mousedragged calls. When I drag from one of the subclasses to the other the mousedragged function will be called until I release the…

the Reverend
- 12,305
- 10
- 66
- 121
1
vote
1 answer
nextKeyView tabbing to a NSBrowser and search view in toolbar
I have a requirement in a Mac OS X app for the user to be able to tab between the follow item in a single window,
NSSearchField within the toolbar
NSBrowser
NSCollectionView
NSCollectionView (second one)
NSComboBox
when the user has tabbing…

Nathan Day
- 5,981
- 2
- 24
- 40
1
vote
1 answer
When multiple NSTextViews are present in a window, the one receiving typed keys isn't necessarily the one receiving command-keys. Why?
I am having a hard time understanding the responder chain in OS X.
I have an NSTextView subclass, and I want it to respond to a command-key and do something. I've created a very simple demonstration of my problem. Anyone interested can see if with…

The Cappy
- 623
- 4
- 8
1
vote
1 answer
UnsafeMutablePointer to [NSObject : AnyObject]
I am overriding NSResponder’s mouseEntered(theEvent: NSEvent) method and want to retrieve the value I set when creating a NSTrackingArea in Swift. I am using this constructor to create the NSTrackingArea and pass the following object as…

RHB
- 102
- 2
- 11
1
vote
1 answer
What is the difference between moveBackward: and moveLeft: when using NSResponder -interpretKeyEvents:?
I'm implementing a custom text box using -interpretKeyEvents: and am trying to figure out what the difference is between moveBackward: vs moveLeft: and moveForward: vs moveRight:. moveLeft: is bound to the left arrow and moveBackward: is bound to…

nciagra
- 71
- 4
1
vote
0 answers
magnifyWithEvent: only called when app is activated
My NSViewController implements magnifyWithEvent:. The window is a NSPanel with NSNonactivatingPanelMask as a styleMask flag.
Because of that, opening the window and using it will not activate the NSApplication. This means that the old window will…

IluTov
- 6,807
- 6
- 41
- 103