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:
|
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;
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue