Mailing Lists: Apple Mailing Lists

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

Behavior of InstallEventHandler differs from Reference (10.3.9)



In all the following, I am using 1 EventSpec per call to InstallEventHandler
If I register the same handler with the same EventSpec same target, but different user data, it succeeds.
If I register the same handler with two different EventSpecs, but the same target and user data it fails with error eventHandlerAlreadyInstalledErr


The manual says this error should come from registering the same handler with the same EventSpec twice; it says nothing about dependence on user data. (This behavior doesn't make much sense, either.)

Is this a bug in InstallEventHandler?

As an example, I attempted to install the array event_defs below in the obvious programmatic way.

struct CommandDef {
int evtClass;
int evtType;
EventHandlerUPP handler;
UInt32 targetID;
void * userData;
};
typedef struct CommandDef CommandDef;

static OSStatus Keypress( EventHandlerCallRef inCallRef,
EventRef inEvent, void *inUserData );


const CommandDef event_defs [] =
{

{ 'keyb', kEventRawKeyDown, Keypress, 0, NULL }, // SUCCEED
// Bug?
{ 'keyb', kEventRawKeyDown, Keypress, 0, (1 }, // SUCCEED?
// Bug?
{ 'keyb', kEventRawKeyRepeat, Keypress, 0, NULL }, // FAIL?
{ 'FAKE', 'FAKE', Keypress, 0, NULL } // FAIL?
};
 _______________________________________________
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



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.