CodePudding user response:
Met before this, if want to achieve, the engine is not to distinguish the or so key insideCodePudding user response:
_mouseListener=EventListenerMouse: : create ();_mouseListener - & gt; onm ouseUp=CC_CALLBACK_1 (MouseEventTest: : onm ouseUp, this);
_mouseListener - & gt; onm ouseDown=CC_CALLBACK_1 (MouseEventTest: : onm ouseDown, this);
Void MouseEventTest: : onm ouseDown Event (Event *)
{
EventMouse * e=(EventMouse *) event;
STD: : string STR="Mouse Down detected, Key:";
STR +=tostr (static_cast & lt; int> (e - & gt; GetMouseButton ()));
_labelAction - & gt; SetString (STR) c_str ());
}
Void MouseEventTest: : onm ouseUp Event (Event *)
{
EventMouse * e=(EventMouse *) event;
STD: : string STR="Mouse Up detected, Key:";
STR +=tostr (static_cast & lt; int> (e - & gt; GetMouseButton ()));
_labelAction - & gt; SetString (STR) c_str ());
}
The left mouse button to return to zero right returns 1