Skip to content

Commit eb1278f

Browse files
committed
Support TextInputAction
Signed-off-by: swan.seo <swan.seo@samsung.com>
1 parent a152671 commit eb1278f

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

flutter/shell/platform/tizen/channels/text_input_channel.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ void TextInputChannel::HandleMethodCall(
167167
if (input_action_iter != client_config.MemberEnd() &&
168168
input_action_iter->value.IsString()) {
169169
input_action_ = input_action_iter->value.GetString();
170+
input_method_context_->SetInputAction(input_action_);
170171
}
171172

172173
text_capitalization_ = "";

flutter/shell/platform/tizen/tizen_input_method_context.cc

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,32 @@ bool TizenInputMethodContext::IsInputPanelShown() {
273273
return state == ECORE_IMF_INPUT_PANEL_STATE_SHOW;
274274
}
275275

276+
void TizenInputMethodContext::SetInputAction(const std::string& input_action) {
277+
FT_ASSERT(imf_context_);
278+
Ecore_IMF_Input_Panel_Return_Key_Type return_key_type =
279+
ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
280+
281+
// Not support : none, previous, continueAction, route, emergencycall, newline
282+
if (input_action == "TextInputAction.unspecified") {
283+
return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
284+
} else if (input_action == "TextInputAction.done") {
285+
return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE;
286+
} else if (input_action == "TextInputAction.go") {
287+
return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO;
288+
} else if (input_action == "TextInputAction.join") {
289+
return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN;
290+
} else if (input_action == "TextInputAction.next") {
291+
return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT;
292+
} else if (input_action == "TextInputAction.search") {
293+
return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH;
294+
} else if (input_action == "TextInputAction.send") {
295+
return_key_type = ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND;
296+
}
297+
298+
ecore_imf_context_input_panel_return_key_type_set(imf_context_,
299+
return_key_type);
300+
}
301+
276302
void TizenInputMethodContext::SetInputPanelLayout(
277303
const std::string& input_type) {
278304
FT_ASSERT(imf_context_);

flutter/shell/platform/tizen/tizen_input_method_context.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class TizenInputMethodContext {
5757

5858
bool IsInputPanelShown();
5959

60+
void SetInputAction(const std::string& input_action);
61+
6062
void SetInputPanelLayout(const std::string& layout);
6163

6264
void SetInputPanelLayoutVariation(bool is_signed, bool is_decimal);

0 commit comments

Comments
 (0)