When I input Chinese, the mouse pointer will not move to the latest position, and English has no such problem.
It would help to have a complete program demonstrating the problem (or just of the gio-examples). Also, please state your operating system and the inputs (what you enter, what did you expect to see, what happened instead).
https://github.com/Esword618/giogui
This is my github link. When I input the Chinese "什么", I find that the mouse pointer does not move. When I input English letters or numbers, there is no such problem.
The following is a gif demonstration.
I don't know why gif can't be displayed. This is a gif link.
https://github.com/Esword618/giogui/blob/main/img/pointerbug.gif
Thank you for the clear report. I don't have a Window machine at the moment, so the issue is difficult to reproduce for me. Perhaps you can take a look at the Windows IME calls (here) in order to determine what's different from English characters to Chinese composite text. Thanks you.
Has Chinese IME ever worked for you? If so, please try to
git bisect
to a particular commit that breaks it.
OK, I'll try to solve this problem. What I know is that a Chinese character has three lengths, while an English character has one length. I think this should be the length. I can make a mistake here. I treat Chinese characters as one length.
I don't know how to use IME. I haven't. I plan to study it and see if I can solve this problem. I can't guarantee success.
I finally got a Windows 11 VM up and running, but I can't reproduce the issue. I tried
- Running your example:
% go run github.com/Esword618/giogui@latest go: downloading github.com/Esword618/giogui v0.0.0-20221117034659-09f171727686 go: github.com/Esword618/giogui@latest: github.com/Esword618/giogui@v0.0.0-20221117034659-09f171727686: parsing go.mod: module declares its path as: guigio but was required as: github.com/Esword618/giogui
I think you need to declare your module name as github.com/Esword618/giogui
- Ran Kitchen example with Chinese input enabled:
$ go run gioui.org/example/kitchen
however, inputting Chinese characters advanced the caret as expected.
My Chinese input looks different than yours, however.
Does Chinese input work for you with the kitchen example?
The default font of Kitchen does not support Chinese. Have you changed its font?
I have not, but the characters are replaced with rectangles and that's enough to verify the issue. You can tell whether the caret moves correctly or not after inserting text.
https://github.com/Esword618/giogui/blob/main/img/kitchen.mp4
You can take a look at the video link. This is recorded by the example I ran with the following command. Obviously, when I input Chinese characters, I will find that the pointer and cursor do not move.
go run gioui.org/example/kitchen
It seems that you're running Windows 11 as well, right? If so, the only difference I can think of is our Input Method Editor (IME). I've tested the "Chinese, Simplified" input method, and it works. What are you using?
I've uploaded a screencast of my testing here: https://file.io/O9G1HN1UgpXo .
I found a problem. The input method software I used is a third-party software, not Microsoft's own input method software, so this problem occurs. But why does the third-party input method software not support it?
When I first input the Chinese character "你好是的", I used Microsoft's own input method. The second time I input "你好是的", I used a third-party input method called Sogou input method.
I've uploaded a screencast of my testing here:https://file.io/HynEsbyaNhgX
I uploaded another test video:https://file.io/YJDPrvjeD4MZ
Elias Naur referenced this ticket in commit dee53b3.