Mailing Lists: Apple Mailing Lists

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

Re: kEventTextInputUnicodeForKeyEvent Propagation?



Eric wrote:
0x93165528 is StandardWindowEventHandler. If no view is focused, it returns eventNotHandledErr. If a view is focused, it returns noErr.
Ah, I see the issue. The standard window event handler, when it gets a UnicodeForKeyEvent event, always extracts the character codes, sends them to the focused view, and returns noErr.

Thanks, Eric. I still wonder why the behavior needs to be this inconsistent.


Basically, you want to prevent the standard handler from running in this case. You can do that by installing a UnicodeForKeyEvent handler yourself on the window, and returning eventPassToNextTargetErr. That will cause the event to skip over any remaining handlers on the window (including the standard handler), and be dispatched to the next target, which is the app target.

This fixes most of the problems. Unfortunately, this breaks the StandardWindowEventHandler's automatic handling of Enter/Escape for default/cancel buttons in dialogs. I guess I could handle those myself, though.


As far as WNE-based Carbon frameworks are concerned: This is a widely used CD recording application which uses the THINK Class Library (TCL). We replaced most of the CViews with HIViews, but the chain of commands and menu bar handling is still heavily TCL-based.

-Florian


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

This email sent to email@hidden
References: 
 >kEventTextInputUnicodeForKeyEvent Propagation? (From: Florian Dejako <email@hidden>)
 >Re: kEventTextInputUnicodeForKeyEvent Propagation? (From: Eric Schlegel <email@hidden>)
 >Re: kEventTextInputUnicodeForKeyEvent Propagation? (From: Florian Dejako <email@hidden>)
 >Re: kEventTextInputUnicodeForKeyEvent Propagation? (From: Eric Schlegel <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.