DNESS / cocos2d-iphone

Automatically exported from code.google.com/p/cocos2d-iphone
1 stars 0 forks source link

ccRightMouseXXX calls not being dispatched #1072

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a layer that responds to ccRightMouseXXX events
2. Set breakpoints within your ccRightMouseXXX event handlers
3. Run your app in debug mode, ctrl click on your layer, verify your breakpoint 
is never hit

What is the expected output? What do you see instead?

The breakpoint should be hit. Note that in cocos 0.99.5 the rightMouseXXX 
handlers in CCEventDispatcher are never executed including in the demo project 
when right clicking during the event test.

What cocos2d version are you using ?

cocos 0.99.5

What iOS / Mac SDK are you using ?

Xcode 3.2.5

Debug or Release ?

debug

Which target device / target OS are you using ?

mac

iOS only: Does this happens on device ? or on the simulator ? or on both ?

Mac only: x86 or i386 ?

x86

Please provide any additional information below.

One workaround for developers running into this is to call the ccRghtMouseXXX 
methods themselves within the corresponding ccMouseXXX methods :

-(BOOL) ccMouseDragged:(NSEvent *)event
{
    if (event.modifierFlags & NSControlKeyMask)
             return [self ccRightMouseDragged:event];

   ...

Original issue reported on code.google.com by dhakim%w...@gtempaccount.com on 30 Dec 2010 at 6:02

GoogleCodeExporter commented 9 years ago

Original comment by ricardoq...@gmail.com on 13 Jan 2011 at 3:47

GoogleCodeExporter commented 9 years ago
It seems that NSView doesn't propagate the right mouse events:

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Applicatio
nKit/Classes/NSView_Class/Reference/NSView.html%23//apple_ref/doc/uid/TP40004149

Discussion
The default implementation calls menuForEvent: and, if non nil, presents the 
contextual menu.

This behavior differs from other mouse events as the event is not passed up the 
responder chain.

Original comment by ricardoq...@gmail.com on 13 Jan 2011 at 4:16

GoogleCodeExporter commented 9 years ago
rescheduled for v1.1

Original comment by ricardoq...@gmail.com on 13 Jul 2011 at 9:44