How use cocos2d-x to check double clicked?

I know about cocos2d-ipone can use

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 
{
    NSSet *allTouches = [event allTouches]; 
    switch ([allTouches count])
   {
        case 1:  
       {

           UITouch *touch = [[allTouches allObjects] objectAtIndex:0];
           switch([touch tapCount]) 
           { 
                 case 1:
                     // 单击!
                    break;
                case 2:
                   //Double tap.
                  // 双击! 
                   break;
       } 
      break;
   }
}

,but what do the cocos2d-x using?

Help……….

1 Like

Get tick in each ccTouchesEnded call, then judge if the duration is smaller then double-click time, for example, 300ms.

Thanks that’s not best………………,change .mm add a count member int style to CCTouche class