Re: Keyboard/Mouse Event Interaction
Re: Keyboard/Mouse Event Interaction
- Subject: Re: Keyboard/Mouse Event Interaction
- From: email@hidden
- Date: Mon, 18 Jul 2016 21:05:42 +0900
You might review the Event programming guide (especially the part about short circuiting) and the responder chain.
That will pull this together in some detail.
Sent from my iPhone
> On Jul 18, 2016, at 7:57 PM, Dave <email@hidden> wrote:
>
> Hi Alastair,
>
> Thanks a lot for this - it makes my life harder but at least I know how it works now.
>
> All the Best
> Dave
>
>> On 17 Jul 2016, at 21:03, Alastair Houghton <email@hidden> wrote:
>>
>> On 17 Jul 2016, at 14:06, Dave <email@hidden> wrote:
>>>
>>> My question is, do the keyboard and Mouse Down Events come in pairs, so that the following would/should not occur:
>>
>> No. KeyDown happens when the key goes down, KeyUp happens when they key comes back up. Likewise with MouseDown and MouseUp, and they can happen in any order relative to one another (or relative to another KeyDown/Up or MouseDown/Up).
>>
>>> Thanks a lot for any info on this. From looking at it, I think that the MouseDown/Up and KeyboardDown/Up must come if pairs with no events to the other device(s) in between, but it would be nice to know for sure!
>>
>> The reason you see this kind of behaviour sometimes is that *some* views process events in a loop in their -mouseDown: handler. See this blog post I wrote in 2007 about event handling, which shows two different ways of handling -mouseDown: and talks a bit about eating keypresses during processing.
>>
>> https://alastairs-place.net/blog/2007/11/19/commands-and-mo/
>>
>> Kind regards,
>>
>> Alastair.
>>
>> --
>> http://alastairs-place.net
>
>
> _______________________________________________
>
> 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
_______________________________________________
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