advertisement

Article:
  Building a Scratch Pad with Cocoa
Subject:   keyDown method doesn't execute before mouseDown
Date:   2002-08-31 18:21:53
From:   whiteman
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.
AW