Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Forwarding keyDown and keyUp
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Forwarding keyDown and keyUp



Hi,

I have a multiple window application-- in one window (window A), which will be active most of the time, there is no input text field. However, I would like to be able
to intercept any keyboard events from this window and forward them to the input text field in the other window (window B). Thus far I have done the following:

1. Connected window A's initial first responder outlet to my custom view. (the only UI element in the window)
2. Overrode -(BOOL)acceptsFirstResponder to return YES in said custom view.
3. Overrode -(void)keyDown:(NSEvent*)theEvent and -(void)keyUp:(NSEvent*)theEvent to
send the messages (via a series of controllers) to the input text field in window B.

However, when I attempt to type anything while window B is active, all I get is system beep sounds which means something somewhere isn't working right.

What steps am I missing? Easier way to do it?

Thanks,
Rick
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.




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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.