Skip to content

Commit

Permalink
Fixed Vita text input
Browse files Browse the repository at this point in the history
  • Loading branch information
Northfear committed Jan 23, 2023
1 parent b67b308 commit 462d877
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/character_editor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1939,10 +1939,6 @@ static int _get_input_str(int win, int cancelKeyCode, char* text, int maxLength,

int rc = 1;

#ifdef __vita__
vitaActivateIme();
#endif

while (rc == 1) {
sharedFpsLimiter.mark();

Expand Down
13 changes: 11 additions & 2 deletions src/input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1294,12 +1294,21 @@ static void idleImpl()

void beginTextInput()
{
#ifdef __vita__
vitaActivateIme();
#else
SDL_StartTextInput();
#endif
}

void endTextInput()
{
#ifdef __vita__
sceImeClose();
ime_active = 0;
#else
SDL_StopTextInput();
#endif
}

#ifdef __vita__
Expand Down Expand Up @@ -1554,9 +1563,9 @@ void vitaActivateIme()
param.arg = NULL;
param.work = libime_work;

int res = sceImeOpen(&param);
int32_t res = sceImeOpen(&param);
if (res < 0) {
sceClibPrintf("Failed to init IME\n");
sceClibPrintf("Failed to init IME: %ld\n", res);
}
ime_active = 1;
}
Expand Down
4 changes: 0 additions & 4 deletions src/loadsave.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2222,10 +2222,6 @@ static int _get_input_str2(int win, int doneKeyCode, int cancelKeyCode, char* de

int rc = 1;

#ifdef __vita__
vitaActivateIme();
#endif

while (rc == 1) {
sharedFpsLimiter.mark();

Expand Down

0 comments on commit 462d877

Please sign in to comment.