Skip to content

Commit

Permalink
A workaround for isIME in Evas GL mode
Browse files Browse the repository at this point in the history
  • Loading branch information
swift-kim committed Apr 19, 2021
1 parent 6e4433f commit 9ca99b8
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions shell/platform/tizen/channels/text_input_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,15 @@ void TextInputChannel::SendStateUpdate(const flutter::TextInputModel& model) {

bool TextInputChannel::FilterEvent(Ecore_Event_Key* keyDownEvent) {
bool handled = false;
bool isIME = ecore_imf_context_keyboard_mode_get(imf_context_) ==
ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE;
bool isIME;

#ifdef TIZEN_RENDERER_EVAS_GL
// It is assumed that no hardware keyboard can be attached in Evas GL mode.
isIME = true;
#else
isIME = ecore_imf_context_keyboard_mode_get(imf_context_) ==
ECORE_IMF_INPUT_PANEL_SW_KEYBOARD_MODE;
#endif

Ecore_IMF_Event_Key_Down ecoreKeyDownEvent;
ecoreKeyDownEvent.keyname = keyDownEvent->keyname;
Expand All @@ -376,11 +383,7 @@ bool TextInputChannel::FilterEvent(Ecore_Event_Key* keyDownEvent) {
EcoreInputModifierToEcoreIMFModifier(keyDownEvent->modifiers);
ecoreKeyDownEvent.locks =
EcoreInputModifierToEcoreIMFLock(keyDownEvent->modifiers);
if (isIME) {
ecoreKeyDownEvent.dev_name = "ime";
} else {
ecoreKeyDownEvent.dev_name = "";
}
ecoreKeyDownEvent.dev_name = isIME ? "ime" : "";
ecoreKeyDownEvent.keycode = keyDownEvent->keycode;

if (isIME && strcmp(keyDownEvent->key, "Select") == 0) {
Expand Down

0 comments on commit 9ca99b8

Please sign in to comment.