[Openmcl-devel] keyDown events

Ron Garret ron at awun.net
Tue Nov 6 11:09:38 PST 2007


This works:

(defclass scribble-view (ns:ns-view)
   ()
   (:metaclass ns:+ns-object))

(ccl::define-objc-method ((:void :mouse-down (:id event)) scribble-view)
   (ccl::slet* ((event-location (ccl::send event 'location-In-Window))
	       (view-location (ccl::send self :convert-Point event- 
location :from-View nil)))
     (with-focused-view self
       (#/drawAtPoint:withAttributes: #@"x" view-location +null-ptr+))))

I can stick a scribble-view in a window and click on it to paint  
little x's all over.  But when I try this:

(ccl::define-objc-method ((:void :key-down (:id event)) scribble-view)
   [do-something...]

it doesn't work.  I activate the window, press some keys, and as far  
as I can tell the key-down method is not invoked at all.  From  
everything that I've read this ought to work.  What am I doing wrong?

rg




More information about the Openmcl-devel mailing list