Re: Strange event result
Re: Strange event result
- Subject: Re: Strange event result
- From: Graham Cox <email@hidden>
- Date: Wed, 07 Nov 2012 11:40:34 +1100
It's looking strongly like a bug in the OS or trackpad driver, and it appears that the additional unexpected events, while odd, are not a direct cause of the bug I have.
I'm responding to 4 event types: LDown, LUp, LDragged and Moved.
I expect Down-Dragged-Up-Moved-Down-Dragged-Up-Moved, etc. which is what I get reliably from a mouse.
With the trackpad, I also get this most of the time, but sometimes it goes directly from moved to dragged without a mouse down, and vice versa sometimes with and without a mouse up.
e.g. Down-Dragged-Up-Moved-Dragged-Moved-Dragged-Up-Moved...
The missing mouse-downs are a problem because my code uses that to advance the state of a state machine, and because that's not happening it isn't working properly. There is a very distinct click of the trackpad's button, but no mouse-down gets delivered. The "dragging finger" generally remains on the trackpad while I click or release the trackpad's mouse button. Again, this seems incorrect to me - the button clicking should ALWAYS send a mouse down and mouse up no matter what other fingers are doing.
I have turned off all the fancy gesture detection in system prefs, but that made no difference.
This is very frustrating because there's probably little I can do in my code to workaround this. I'm going to try setting a flag that means "expect a mouse down" and if I get a drag instead, treat the first drag event as a mouse down. That might work around it but it's pretty poor that the system really isn't working as it should.
Surely others have noticed this? I would have thought mouse downs going missing in a view would be a pretty obvious bug.
--Graham
On 07/11/2012, at 11:08 AM, Graham Cox <email@hidden> wrote:
> Hi all,
>
> Following up on a problem I was having a week or so back with receiving multiple mouse-ups in an event loop, I've narrowed the problem down to the events coming from a trackpad instead of a mouse.
>
> Here's an odd thing:
>
> NSUInteger mask = NSLeftMouseDownMask | NSLeftMouseUpMask | NSLeftMouseDraggedMask | NSMouseMovedMask | NSScrollWheelMask | NSKeyDownMask;
> while( loop )
> {
> theEvent = [NSApp nextEventMatchingMask:mask untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:YES];
>
>
> This is the fragment of code that sets up the mask and grabs the event. I should only get those events that match the mask, right? With a mouse, I do, but with a trackpad I'm also getting right mouse down, right mouse dragged and right mouse up returned. Is that expected? It seems incorrect.
>
> I'm not sure it has a bearing on my bug because I do ignore those events, but OTOH, the bug is only manifest using the trackpad. (Debugging this in the debugger is impossible due to the dynamic nature of the loop, so I'm having to try and log output at key points).
_______________________________________________
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