Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing keyboard events through QC to host application



Hi,

This maybe a cocoa group question: But I thought I'd try here first.

I've been learning cocoa for a while - but lack experience. So pointers to clear docs would be appreciated.

I've have a QC comp in a subclassed NSWindow that has gone full size using the method described at cocoadevcentral http:// cocoadevcentral.com/articles/000028.php


I want to use the 'escape' key to exit full screen mode, but I am finding that the 'forward all events' option set on the QCView in IB is interrupting the events from the NSWindow. ie. When I disable 'forward all events', I can successfully detect keyDown events from the full-screen NSWindow subclass.


(1) How do I detect this keyboard command when 'forward all events' is enabled?

I reckon I could work-around my keyboard events problem by triggering a method by a keyboard press in the QC composition.

I have tried publishing the output of the keyboard patch (not the 'escape' key but 'tab'), and listening for the event in my AppController.

- (BOOL) canBecomeKeyWindow
{
    return YES;
}

is set on the subclassed window.


(2) How should I do this 'listening'? Is there any sample code illustrating how to set up Key-value observation on a published output of a QC patch?


I've googled and searched the group, but no immediate joy.

The technote tn2146 (http://developer.apple.com/technotes/tn2005/ tn2146.html) got me started - but when my application quits. I get the following error:

2007-01-29 19:40:30.163 QCWii[6390] An instance 0x35cb60 of class QCView is being deallocated while key value observers are still registered with it. Break on _NSKVODeallocateLog to start debugging.

In what method do I remove the observer (before the application quits)?

Sorry if these are basic questions.

Thanks,

Ian Grant


******************************* Ian Grant Lecturer in Digital Art Faculty of the Arts Thames Valley University Ealing, UK W5 5DX <email@hidden> *******************************



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.