diff --git a/cocos/base/CCEventListenerTouch.h b/cocos/base/CCEventListenerTouch.h index 353c938e9d..603160b1e9 100644 --- a/cocos/base/CCEventListenerTouch.h +++ b/cocos/base/CCEventListenerTouch.h @@ -52,10 +52,14 @@ public: // public: - std::function onTouchBegan; - std::function onTouchMoved; - std::function onTouchEnded; - std::function onTouchCancelled; + + typedef std::function ccTouchBeganCallback; + typedef std::function ccTouchCallback; + + ccTouchBeganCallback onTouchBegan; + ccTouchCallback onTouchMoved; + ccTouchCallback onTouchEnded; + ccTouchCallback onTouchCancelled; CC_CONSTRUCTOR_ACCESS: EventListenerTouchOneByOne(); @@ -82,10 +86,13 @@ public: virtual bool checkAvailable() override; // public: - std::function&, Event*)> onTouchesBegan; - std::function&, Event*)> onTouchesMoved; - std::function&, Event*)> onTouchesEnded; - std::function&, Event*)> onTouchesCancelled; + + typedef std::function&, Event*)> ccTouchesCallback; + + ccTouchesCallback onTouchesBegan; + ccTouchesCallback onTouchesMoved; + ccTouchesCallback onTouchesEnded; + ccTouchesCallback onTouchesCancelled; CC_CONSTRUCTOR_ACCESS: EventListenerTouchAllAtOnce();