Skip to content

Commit

Permalink
hunt down the problem
Browse files Browse the repository at this point in the history
  • Loading branch information
sonphantrung authored Nov 26, 2024
1 parent 34efe38 commit 9e02b65
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2992,12 +2992,6 @@ static void CheckMessages()
}
}
#endif

#if defined(__IPHONEOS__)
if( !SDL_IsTextInputActive() ) {
StartTextInput();
}
#endif

last_input = input_event();

Expand Down Expand Up @@ -3040,7 +3034,7 @@ static void CheckMessages()
if( SDL_IsTextInputActive() ) {
text_input_active_when_regaining_focus = true;
// Stop text input to not intefere with other programs
SDL_StopTextInput();
StopTextInput();
// Clear uncommited IME text. TODO: commit IME text instead.
last_input = input_event();
last_input.type = input_event_t::keyboard_char;
Expand Down Expand Up @@ -3093,7 +3087,7 @@ static void CheckMessages()
// TODO: Abstract common method with above usage
text_input_active_when_regaining_focus = true;
// Stop text input to not intefere with other programs
SDL_StopTextInput();
StopTextInput();
// Clear uncommited IME text. TODO: commit IME text instead.
last_input = input_event();
last_input.type = input_event_t::keyboard_char;
Expand All @@ -3119,7 +3113,7 @@ static void CheckMessages()
render_target_reset = true;
break;
case SDL_KEYDOWN: {
#if defined(__ANDROID__)
#if defined(__ANDROID__) || defined(__IPHONEOS__)
// Toggle virtual keyboard with Android back button. For some reason I get double inputs, so ignore everything once it's already down.
if( ev.key.keysym.sym == SDLK_AC_BACK && ac_back_down_time == 0 ) {
ac_back_down_time = ticks;
Expand Down

0 comments on commit 9e02b65

Please sign in to comment.