mirror of https://github.com/axmolengine/axmol.git
EventListenerMouse will dispatch EventMouse events
This commit is contained in:
parent
4530043d9b
commit
2f02690394
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue