Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to input Chinese in (TextField)? #399

Closed
Aquarian-Age opened this issue Jul 20, 2020 · 2 comments
Closed

How to input Chinese in (TextField)? #399

Aquarian-Age opened this issue Jul 20, 2020 · 2 comments

Comments

@Aquarian-Age
Copy link

Aquarian-Age commented Jul 20, 2020

Can input English but cannot input Chinese characters

Recorded a video
Link: https://youtu.be/u8lbXtcG2zg

Source code

	edit6 := gi.AddNewTextField(trow, "edit6")
	edit6.Placeholder = "生肖"
	edit6.SetProp("min-width", 90)
	var estr6 string
	edit6.TextFieldSig.Connect(rec.This(), func(recv, send ki.Ki, sig int64, data interface{}) {
		//estr := ""
		if rn, ok := data.([]rune); ok {
			estr6 = string(rn)
		} else if st, ok := data.(string); ok {
			estr6 = st
		}
		fmt.Printf("從: %v 編輯器收到編輯信號: %v  輸入的字符串數據: %s\n", send.Name(), gi.TextFieldSignals(sig), estr6)
	})
@rcoreilly
Copy link
Member

I did some googling and this appears to be the source of the problem, in the glfw backend that we're using: glfw/glfw#41

here's a related bug report in another Go GUI that uses the same backend:
fyne-io/fyne#1079

One thing you could do to get more info: in GoGi Preferences, on the very far right of the toolbar, click on Edit Debug then turn on KeyEventTrace and EventTrace and then try entering something in the field, and paste the trace output here, so we can see what kinds of events are being generated..

It seems like some kind of patch to glfw would be required to fix this -- someone seems to have done it in their own fork, and fixing it would certainly help many users, so if you've got the time and ability to work on this, that would be great!

@Aquarian-Age
Copy link
Author

Aquarian-Age commented Jul 21, 2020

我做了一些谷歌搜索,这似乎是问题的根源,在我们使用的glfw后端中:glfw / glfw#41

这是另一个使用相同后端的Go GUI中的相关错误报告:
fyne-io / fyne#1079

有一两件事你可以做,以获得更多的信息:在空间Gogi首选项,在很远的右侧工具栏,点击Edit Debug然后打开KeyEventTraceEventTrace再尝试在字段中输入一些东西,并粘贴在这里跟踪输出,所以我们可以看到什么各种事件正在生成..

似乎需要对glfw进行某种修补才能解决此问题-似乎有人在自己的分叉中完成了此工作,并且修复它肯定会对许多用户有所帮助,因此,如果您有足够的时间和能力进行此工作,这个,那太好了!

I did some googling and this appears to be the source of the problem, in the glfw backend that we're using: glfw/glfw#41

here's a related bug report in another Go GUI that uses the same backend:
fyne-io/fyne#1079

One thing you could do to get more info: in GoGi Preferences, on the very far right of the toolbar, click on Edit Debug then turn on KeyEventTrace and EventTrace and then try entering something in the field, and paste the trace output here, so we can see what kinds of events are being generated..

It seems like some kind of patch to glfw would be required to fix this -- someone seems to have done it in their own fork, and fixing it would certainly help many users, so if you've got the time and ability to work on this, that would be great!


After opening the debugging option, inputting Chinese characters does not output anything
Operation video:https://youtu.be/lfjJrNGxf-s
It seems that this is a problem with glfw and the input method. . .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants