Re: Key event data not available in eventRef
Re: Key event data not available in eventRef
- Subject: Re: Key event data not available in eventRef
- From: "Mills, Steve" <email@hidden>
- Date: Tue, 04 Mar 2014 19:28:35 +0000
- Thread-topic: Key event data not available in eventRef
On Mar 4, 2014, at 13:03:34, Mills, Steve <email@hidden> wrote:
> I'm seeing something really odd. We get the NSEvent for the current keyDown when the user types an unmodified space. From that we get the eventRef to pass to some legacy code. Sometimes that EventRef will contain the correct space character (32) in kEventParamKeyMacCharCodes and the correct space character (32) in kEventParamKeyUnicodes. Other times it will pass back an INcorrect 0-value for kEventParamKeyMacCharCodes (and return noErr) and generate error -9870 (eventParameterNotFoundErr) for kEventParamKeyUnicodes. In both cases the kEventParamKeyCode will be correct (49). In all cases, the NSEvent contains the correct space character.
>
> Any ideas why NSEvent is creating an incorrect EventRef under some circumstances but not others? In our app, switching tools causes the different results, which will swap in/out tool-specific menus in the menubar. None of the menus use modified or unmodified space as a key equiv.
Weird. If I set a breakpoint in our app's sendEvent handler and get the eventRef, it contains the correct key char and uni char. But by the time the NSEvent's _eventRef is NULL (so I guess NSApplication has duplicated the NSEvent but not the EventRef when we pass it to super), and then getting the eventRef from that version of the NSEvent produces the bad key char and uni char. This is getting more mysterious.
--
Steve Mills
office: 952-818-3871
home: 952-401-6255
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden