EventListenerMouse will dispatch EventMouse events

This commit is contained in:
Seivan Heidari 2015-09-01 19:38:45 +02:00
parent 4530043d9b
commit 2f02690394
2 changed files with 8 additions and 8 deletions

View File

@ -82,19 +82,19 @@ bool EventListenerMouse::init()
{
case EventMouse::MouseEventType::MOUSE_DOWN:
if(onMouseDown != nullptr)
onMouseDown(event);
onMouseDown(mouseEvent);
break;
case EventMouse::MouseEventType::MOUSE_UP:
if(onMouseUp != nullptr)
onMouseUp(event);
onMouseUp(mouseEvent);
break;
case EventMouse::MouseEventType::MOUSE_MOVE:
if(onMouseMove != nullptr)
onMouseMove(event);
onMouseMove(mouseEvent);
break;
case EventMouse::MouseEventType::MOUSE_SCROLL:
if(onMouseScroll != nullptr)
onMouseScroll(event);
onMouseScroll(mouseEvent);
break;
default:
break;

View File

@ -57,10 +57,10 @@ public:
virtual EventListenerMouse* clone() override;
virtual bool checkAvailable() override;
std::function<void(Event* event)> onMouseDown;
std::function<void(Event* event)> onMouseUp;
std::function<void(Event* event)> onMouseMove;
std::function<void(Event* event)> onMouseScroll;
std::function<void(EventMouse* event)> onMouseDown;
std::function<void(EventMouse* event)> onMouseUp;
std::function<void(EventMouse* event)> onMouseMove;
std::function<void(EventMouse* event)> onMouseScroll;
CC_CONSTRUCTOR_ACCESS:
EventListenerMouse();