Skip to content

Commit

Permalink
Fix focus box errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xfangfang committed Jan 31, 2025
1 parent 07339bd commit f36517f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions library/lib/platforms/psv/psv_ime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,22 @@ class PsvImeView : public View
return;

uint8_t utf8_buffer[SCE_IME_DIALOG_MAX_TEXT_LENGTH];
std::string text;
SceImeDialogResult result;
memset(&result, 0, sizeof(SceImeDialogResult));
sceImeDialogGetResult(&result);
if (result.button == SCE_IME_DIALOG_BUTTON_ENTER)
{

utf16_to_utf8(ime_buffer, utf8_buffer);
std::string text { (const char*)utf8_buffer };
if (callback)
callback(text);
text = std::string{ (const char*)utf8_buffer };
}

sceImeDialogTerm();
Application::popActivity(TransitionAnimation::NONE);
Application::popActivity(TransitionAnimation::NONE, [this, text](){
if (!text.empty() && callback)
callback(text);
});
Application::unblockInputs();
running = false;
}
Expand Down Expand Up @@ -205,7 +207,7 @@ bool PsvImeManager::openForText(std::function<void(std::string)> f, std::string
ime->setInitialText(initialText);
ime->setMaxStringLength(maxStringLength);
ret = ime->openImeDialog();
Application::pushActivity(new Activity(ime));
Application::pushActivity(new Activity(ime), TransitionAnimation::NONE);
return ret;
}

Expand Down Expand Up @@ -239,7 +241,7 @@ bool PsvImeManager::openForNumber(std::function<void(long)> f, std::string heade
ime->setInitialText(initialText);
ime->setMaxStringLength(maxStringLength);
ret = ime->openImeDialog();
Application::pushActivity(new Activity(ime));
Application::pushActivity(new Activity(ime), TransitionAnimation::NONE);
return ret;
}

Expand Down

0 comments on commit f36517f

Please sign in to comment.