Skip to content

Commit 2a9b84e

Browse files
committed
On most platforms, start text input on newly-created windows.
SDL2 defaulted to text input _on_ for desktop platforms, SDL3 does not for any platform. Fixes libsdl-org#183.
1 parent 0af491c commit 2a9b84e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/sdl2_compat.c

+5
Original file line numberDiff line numberDiff line change
@@ -6988,6 +6988,11 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
69886988
SDL_SetWindowData(window, PROP_WINDOW_PARENT_POINTER, parent);
69896989
}
69906990
}
6991+
6992+
#if !defined(SDL_PLATFORM_IOS) && !defined(SDL_PLATFORM_ANDROID) // (and maybe others...?)
6993+
SDL3_StartTextInput(window);
6994+
#endif
6995+
69916996
return window;
69926997
}
69936998

src/sdl3_syms.h

+1
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,7 @@ SDL3_SYM_PASSTHROUGH_RETCODE(bool,ShowSimpleMessageBox,(Uint32 a, const char *b,
670670
SDL3_SYM(bool,ShowWindow,(SDL_Window *a),(a),return)
671671
SDL3_SYM(void,SignalCondition,(SDL_Condition *a),(a),return)
672672
SDL3_SYM(void,SignalSemaphore,(SDL_Semaphore *a),(a),return)
673+
SDL3_SYM(bool,StartTextInput,(SDL_Window *a),(a),return)
673674
SDL3_SYM(bool,StartTextInputWithProperties,(SDL_Window *a, SDL_PropertiesID b),(a,b),return)
674675
SDL3_SYM(bool,StopTextInput,(SDL_Window *a),(a),return)
675676
SDL3_SYM(bool,SurfaceHasColorKey,(SDL_Surface *a),(a),return)

0 commit comments

Comments
 (0)