Add inp_ime_native_ui to toggle native IME UI on Windows

Add `inp_ime_native_ui` on Windows to use native IME UI instead of rendering the candidate list in the client.

Always set the SDL hint to use native UI on non-Windows, as we cannot determine the list of candidates on those systems.
This commit is contained in:
Robert Müller 2023-05-26 15:31:40 +02:00
parent a5332f0b11
commit 448a39768b
2 changed files with 9 additions and 0 deletions

View file

@ -4787,6 +4787,12 @@ int main(int argc, const char **argv)
SDL_SetHint("SDL_MAC_OPENGL_ASYNC_DISPATCH", "1");
#endif
#if defined(CONF_FAMILY_WINDOWS)
SDL_SetHint("SDL_IME_SHOW_UI", g_Config.m_InpImeNativeUi ? "1" : "0");
#else
SDL_SetHint("SDL_IME_SHOW_UI", "1");
#endif
// init SDL
if(SDL_Init(0) < 0)
{

View file

@ -131,6 +131,9 @@ MACRO_CONFIG_INT(InpMousesens, inp_mousesens, 200, 1, 100000, CFGFLAG_SAVE | CFG
MACRO_CONFIG_INT(InpMouseOld, inp_mouseold, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Use old mouse mode (warp mouse instead of raw input)")
MACRO_CONFIG_INT(InpTranslatedKeys, inp_translated_keys, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Translate keys before interpreting them, respects keyboard layouts")
MACRO_CONFIG_INT(InpIgnoredModifiers, inp_ignored_modifiers, 0, 0, 65536, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Ignored keyboard modifier mask")
#if defined(CONF_FAMILY_WINDOWS)
MACRO_CONFIG_INT(InpImeNativeUi, inp_ime_native_ui, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Use native UI for IME (may cause IME to not work in fullscreen mode) (changing requires restart)")
#endif
MACRO_CONFIG_INT(InpControllerEnable, inp_controller_enable, 0, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Enable controller")
MACRO_CONFIG_STR(InpControllerGUID, inp_controller_guid, 34, "", CFGFLAG_SAVE | CFGFLAG_CLIENT, "Controller GUID which uniquely identifies the active controller")