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: case EventMouse::MouseEventType::MOUSE_DOWN:
if(onMouseDown != nullptr) if(onMouseDown != nullptr)
onMouseDown(event); onMouseDown(mouseEvent);
break; break;
case EventMouse::MouseEventType::MOUSE_UP: case EventMouse::MouseEventType::MOUSE_UP:
if(onMouseUp != nullptr) if(onMouseUp != nullptr)
onMouseUp(event); onMouseUp(mouseEvent);
break; break;
case EventMouse::MouseEventType::MOUSE_MOVE: case EventMouse::MouseEventType::MOUSE_MOVE:
if(onMouseMove != nullptr) if(onMouseMove != nullptr)
onMouseMove(event); onMouseMove(mouseEvent);
break; break;
case EventMouse::MouseEventType::MOUSE_SCROLL: case EventMouse::MouseEventType::MOUSE_SCROLL:
if(onMouseScroll != nullptr) if(onMouseScroll != nullptr)
onMouseScroll(event); onMouseScroll(mouseEvent);
break; break;
default: default:
break; break;

View File

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