||Building a Scratch Pad with Cocoa|
|Subject:||keyDown method doesn't execute before mouseDown|
In your scratchPad program the keyDown method will not execute until there is a mouse clicked in the view. (Try adding a NSLog() function call to keyDown and pressing a before and after you make your first drawing.) This does not matter in your program where the overridden keyDown method has no effect unless the user has clicked and dragged the mouse in the View. However, I am trying to use this code in a different app. How do you initialize the view so that it will accept key down events before a mouse has been clicked in the View.