diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2022-01-29 00:11:56 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2022-01-29 00:11:56 +0300 |
commit | 4311a32bc2d9c9e5db475a75cac5b11760f4db71 (patch) | |
tree | bfdbb7451ba7653101169f7fdcf006201ddbcbc3 /source/blender | |
parent | ace1b6a73a0b3e8360640f9251ac30d874365cf8 (diff) |
Win IME: Ideographic Full Stop to Decimal Point
Convert Ideographic Full Stop, used in Simplified Chinese and Japanese,
to Decimal Point when entering numbers into numerical inputs.
See D13903 for more details
Differential Revision: https://developer.blender.org/D13903
Reviewed by Brecht Van Lommel
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 905fd452b6c..a171160d020 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3957,7 +3957,14 @@ static void ui_do_but_textedit( ui_textedit_delete_selection(but, data); } if (event->type == WM_IME_COMPOSITE_EVENT && ime_data->result_len) { - ui_textedit_insert_buf(but, data, ime_data->str_result, ime_data->result_len); + if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER) && + strcmp(ime_data->str_result, "\xE3\x80\x82") == 0) { + /* Convert Ideographic Full Stop (U+3002) to decimal point when entering numbers. */ + ui_textedit_insert_ascii(but, data, '.'); + } + else { + ui_textedit_insert_buf(but, data, ime_data->str_result, ime_data->result_len); + } } } else if (event->type == WM_IME_COMPOSITE_END) { |