Subject: Re: NSEvent timestamp is zero
Subject: Re: NSEvent timestamp is zero
- Subject: Subject: Re: NSEvent timestamp is zero
- From: Kirk Kerekes <email@hidden>
- Date: Thu, 7 Jan 2010 11:44:14 -0600
> 1. I have an NSButton that toggles an operation between active and suspended.
> 2. At some point the operation completes and I process the results of the operation.
> 3. The user can still toggle the operation for the few seconds that the result is being processed.
>
Don't discard, prevent.
Disable the button when you don't want clicks on it to register. Enable it when you do.
Discarding valid clicks is bad UI. Having a button enabled that doesn't work is bad UI.
> I wish to discard the NSButton action triggering events that occur while the results are processed to stop a further operation from being initiated.
> Once the operation is done and processed I don't want to respond to any previous mouse click events that remain in the event queue for that button.
> Filtering on the timestamp seemed like the way to go.
>
> It seems curious that there is no message such as [NSEvent currentTimestamp] as the timestamp is required by most of the NSEvent factor methods.
> Probably explains why the app kit generated event has a zero timestamp.
>
> sysctl doesn't seem to offer the system up time, just kernel boot time (corrections welcome).
>
> I did some brief examination of using a mach clock timer but I might be on completely the wrong track.
>
> There might be other ways of achieving my desired behaviour but the event filter is appealing.
>
> Thanks
>
> jonathan
_______________________________________________
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