Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mouseDown mouseUp clickCount threshold #1664

Closed
BlairDuncan opened this issue Aug 28, 2012 · 9 comments
Closed

mouseDown mouseUp clickCount threshold #1664

BlairDuncan opened this issue Aug 28, 2012 · 9 comments

Comments

@BlairDuncan
Copy link
Contributor

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/nsevent_Class/Reference/Reference.html#//apple_ref/doc/uid/20000016-BBCCAJIG
In cocoa, if the mouse is held down (without moving it) for an extended period of time and then released, the clickCount is reset to 0 and the clickCount of the next mouseDown is 1.
In cappuccino, no matter how long you hold the mouse down, the clickCount is always incremented.

Moving the mouse resets the clickCount to zero.

It can been seen in the following example:

@implementation AppController : CPObject
{

}

- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
    var window = [[CPWindow alloc] initWithContentRect:CPRectMake(30, 30, 200, 200) styleMask:CPTitledWindowMask | CPClosableWindowMask];
    [window orderFront:self];
}    


@end

@implementation CPView (logClickCount)

- (void)mouseDown:(CPEvent)anEvent
{
console.log(_cmd + " clickCount=" + [anEvent clickCount]);
    if ([self mouseDownCanMoveWindow])
        [super mouseDown:anEvent];
}

@end
@cappbot
Copy link

cappbot commented Aug 28, 2012

Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.

@aljungberg
Copy link
Member

This is probably the same issue as #1666. The clickCount of mouseDown depends on the time since the previous mouseDown (not since the mouseUp), so this should work like in Cocoa.

+bug
+AppKit
+#needs-confirmation

@cappbot
Copy link

cappbot commented Aug 31, 2012

Milestone: Someday. Labels: #needs-confirmation, #new, AppKit, bug. What's next? This issue needs a volunteer to independently reproduce the issue.

@BlairDuncan
Copy link
Contributor Author

The fix for issue #1666 although it has made it work better it has not completely fixed this issue. The documents clearly state that when the user holds down the mouse for an extended period of time and then releases it, the clickCount should return 0. With the new fix it returns it still returns 1 and not 0 on mouseUp.

@aljungberg
Copy link
Member

I find that a little strange since there has been exactly 1 mouseUp in recent times when you release the button. But the documentation does agree with you.

@aparajita
Copy link
Contributor

#accepted

@cappbot
Copy link

cappbot commented Feb 11, 2013

Milestone: Someday. Labels: #accepted, AppKit, bug. What's next? A reviewer should examine this issue.

@aparajita
Copy link
Contributor

I am not seeing the behavior you described in the latest master. What you did uncover is that CPView -mouseDown is being called twice for each click, which is wrong.

#fixed

@cappbot
Copy link

cappbot commented Feb 19, 2013

Milestone: Someday. Labels: #fixed, AppKit, bug. What's next? This issue is considered successfully resolved.

@cappbot cappbot closed this as completed Feb 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants