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?




On Jul 28, 2005, at 10:50 AM, Florian Dejako wrote:

Then with a view focused:

Sending Event to 0x1EB3430: kEventTextInputUnicodeForKeyEvent
Called handler 0x93165528. Event was handled
Leaving target 0x1EB3430 with result 0
Leaving target 0x1E6A8B0 with result 0


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.


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.

-eric

_______________________________________________
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>)



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.