求助:如何区分用户点击空白区域导致的editBoxReturn

cocos2d-js v3.0

我创建了一个EditBox, 在其delegate中,编写了editBoxReturn方法:

editBoxReturn: function (sender) {
cc.log(‘edit box return’);
},

问题是,不论时我点击键盘上的回车,还是点击layer上的其它地方空白处,都会触发这个函数。

我希望区分开来,在点击空白处时,不要把当前的信息发送出去。只有显示点击键盘的enter时,才发送。

请问该怎样实现?万分感谢

有人知道怎么做么?帮帮忙?谢谢!

如果是ios的话, 把 pDelegate->editBoxReturn(getEditBoxImplIOS()->getEditBox()); 移到 - (BOOL)textFieldShouldReturn:(UITextField *)sender 这个函数里面。

— Begin quote from ____

引用第2楼meay_je于2014-11-28 09:39发表的 :
如果是ios的话, 把 pDelegate->editBoxReturn(getEditBoxImplIOS()->getEditBox()); 移到 - (BOOL)textFieldShouldReturn:(UITextField *)sender 这个函数里面。
http://www.cocoachina.com/bbs/job.php?action=topost&tid=271070&pid=1184571

— End quote

你是说改cocos2d-js的源码么?

为啥lua就没法实现delegate呢,而且手机上点击空白区域不会触发return