diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-03 13:18:53 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-05-03 13:20:40 +0300 |
commit | b34f177a39ce9fdfac05f60d21f6b763833f00f2 (patch) | |
tree | f58901c1866029a8acdb3cff40a2eae3dc832dfe | |
parent | bff15770a962ae931c1e891ed76fd195ce5b2994 (diff) |
Fix T47841: Shift-space doesn't type space in type-in fields on Windows
Shift-space was reserved for IME support, however IME will only
be enabled on certain languages. We can avoid any IME-related
exceptions form other languages without too much trouble.
There's one weak point around ui_ime_is_lang_supported() tho,
which is it might be doing string comparison a bit too much
often now, this we can avoid by handling those checks from BLT.
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index ce264051609..c6cd03d7ac7 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -2950,11 +2950,12 @@ static bool ui_textedit_copypaste(uiBut *but, uiHandleButtonData *data, const in static bool ui_ime_is_lang_supported(void) { const char *uilng = BLT_lang_get(); - const bool is_lang_supported = STREQ(uilng, "zh_CN") || - STREQ(uilng, "zh_TW") || - STREQ(uilng, "ja_JP"); - - return ((U.transopts & USER_DOTRANSLATE) && is_lang_supported); + if (U.transopts & USER_DOTRANSLATE) { + return STREQ(uilng, "zh_CN") || + STREQ(uilng, "zh_TW") || + STREQ(uilng, "ja_JP"); + } + return false; } /* enable ime, and set up uibut ime data */ @@ -3405,7 +3406,7 @@ static void ui_do_but_textedit(bContext *C, uiBlock *block, uiBut *but, uiHandle #ifdef WITH_INPUT_IME && !is_ime_composing && - !WM_event_is_ime_switch(event) + (!WM_event_is_ime_switch(event) || !ui_ime_is_lang_supported()) #endif ) { |