godot icon indicating copy to clipboard operation
godot copied to clipboard

Annoying letters left when switching chinese input method to english input method

Open MadeScientist opened this issue 9 months ago • 1 comments

Tested versions

  • Reproducible in: 4.3 stable, 4.4 rc1

System information

Godot v4.4.rc1 - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 32.0.15.6603) - Intel(R) Core(TM) i5-6300HQ CPU @ 2.30GHz (4 threads)

Issue description

Maybe related to #96215. Using shift+ctrl or win+space to switch from Chinese IME to English IME during an unconfirmed composition will cause some annoying ghost letters left. No problem occurs when switching IMEs via mouse left-click. This issue occurs in all places in Godot. I can't reproduce it outside of godot e.g. notepad, GitHub text editor, webpage address or any other places. I only found two solutions to kill the annoying ghost letters. Clicking on other editable places or switching back to Chinese IME to reenter words. Backspace and delete don't work. The most frustrating part is that if you provide a TextEdit/LineEdit allowing players to input text, they may encounter this issue when using a Chinese IME.

Edit: Can't reproduce with Japanese IME. Can't reproduce with Korean IME. Test switching Chinese IME to Japanese/Korean IMEs can also reproduce this issue.

Annoying letters left: Image

Reproducible:

Enabling sound will help understand the issue.

  1. Script Editor

https://github.com/user-attachments/assets/dc52e17e-362c-4175-80c1-09219eb054b4

  1. Filters

https://github.com/user-attachments/assets/860a9685-fa2b-4a52-81a0-26ffd8aadffe

https://github.com/user-attachments/assets/a7094b1f-1c24-4977-ab0d-30cce74e03d2

  1. Control's Text

https://github.com/user-attachments/assets/db312ad6-fdfe-46b4-b228-48ec337baba0

  1. TextEdit Input

https://github.com/user-attachments/assets/b0bcde66-0354-4e79-bfb7-eedc922361ad

  1. LineEdit Input

https://github.com/user-attachments/assets/18c5490b-79b2-4391-a323-71a5e9f917a2

Correct Behavior:

The correct behavior should be to cancel this input when switching.

  1. Github

https://github.com/user-attachments/assets/cd71fc32-9eca-4611-95d5-e50f7377a465

  1. Address

https://github.com/user-attachments/assets/429fd675-2ead-4531-bac4-ded6f6f2de15

Steps to reproduce

  1. Activate any Chinese IME e.g. Microsoft Pinyin IME is also able to reproduce the issue
  2. Try to type some letters in wherever
  3. Don't press enter or shift to confirm English words input. And also don't press space to confirm Chinese words input
  4. Just use shift+ctrl or win+space to switch to English(or other languages) IME
  5. You will see some annoying underlined ghost letters left

Minimal reproduction project (MRP)

N/A

MadeScientist avatar Feb 22 '25 17:02 MadeScientist

Duplicate of #81990?😭

MadeScientist avatar Feb 22 '25 21:02 MadeScientist

Add another interesting discovery, Chinese IME seems to separate Chinese characters with single quotation marks before confirming input, and these single quotation marks are obviously recognized by the editor.

Demo:

https://github.com/user-attachments/assets/7e43889a-9ae6-4a33-be48-7812aa56b076

MadeScientist avatar May 26 '25 17:05 MadeScientist

Newly added: Behavior comparison of Chinese and Japanese IME

https://github.com/user-attachments/assets/7f9623c6-2749-45d6-88a1-27e9fabcccde

When using Japanese IME, switching IME will confirm this input(consistent with using the left mouse button or enter or space bar to confirm input, etc.) When using Chinese IME, switching IME will leave input cache with underline.

Note: In the above demonstration, the first line uses the left mouse button to confirm, and the second line uses switching IME.

MadeScientist avatar Jun 08 '25 02:06 MadeScientist