Fix bug of returning UNKNOWN event for return type key SEARCH/SEND in EditBox for Android and SEARCH for iOS. (#18192)

This commit is contained in:
Felippe Durán 2017-11-01 07:33:31 -02:00 committed by minggo
parent d1a8e73be4
commit d651298d3e
2 changed files with 4 additions and 2 deletions

View File

@ -204,7 +204,8 @@ public class Cocos2dxEditBoxHelper {
editBox.endAction = Cocos2dxEditBox.kEndActionNext;
Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index);
return true;
} else if (actionId == EditorInfo.IME_ACTION_DONE) {
} else if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_SEARCH) {
editBox.endAction = Cocos2dxEditBox.kEndActionReturn;
Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index);
}
return false;

View File

@ -293,7 +293,8 @@
if (self.keyboardReturnType == cocos2d::ui::EditBox::KeyboardReturnType::NEXT) {
action = cocos2d::ui::EditBoxDelegate::EditBoxEndAction::TAB_TO_NEXT;
} else if (self.keyboardReturnType == cocos2d::ui::EditBox::KeyboardReturnType::GO ||
self.keyboardReturnType == cocos2d::ui::EditBox::KeyboardReturnType::SEND) {
self.keyboardReturnType == cocos2d::ui::EditBox::KeyboardReturnType::SEND ||
self.keyboardReturnType == cocos2d::ui::EditBox::KeyboardReturnType::SEARCH) {
action = cocos2d::ui::EditBoxDelegate::EditBoxEndAction::RETURN;
}
}