mirror of https://github.com/axmolengine/axmol.git
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:
parent
d1a8e73be4
commit
d651298d3e
|
@ -204,7 +204,8 @@ public class Cocos2dxEditBoxHelper {
|
||||||
editBox.endAction = Cocos2dxEditBox.kEndActionNext;
|
editBox.endAction = Cocos2dxEditBox.kEndActionNext;
|
||||||
Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index);
|
Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index);
|
||||||
return true;
|
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);
|
Cocos2dxEditBoxHelper.closeKeyboardOnUiThread(index);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -293,7 +293,8 @@
|
||||||
if (self.keyboardReturnType == cocos2d::ui::EditBox::KeyboardReturnType::NEXT) {
|
if (self.keyboardReturnType == cocos2d::ui::EditBox::KeyboardReturnType::NEXT) {
|
||||||
action = cocos2d::ui::EditBoxDelegate::EditBoxEndAction::TAB_TO_NEXT;
|
action = cocos2d::ui::EditBoxDelegate::EditBoxEndAction::TAB_TO_NEXT;
|
||||||
} else if (self.keyboardReturnType == cocos2d::ui::EditBox::KeyboardReturnType::GO ||
|
} 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;
|
action = cocos2d::ui::EditBoxDelegate::EditBoxEndAction::RETURN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue