-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
LineEdit can not input Chinese Characters on iOS devices #43256
Comments
@alexzheng Did you change the font in your project to use a font that can display Chinese characters? The default project font only contains Latin-1 characters. Unknown characters will be invisible. |
Yes, I have changed the font that can display any Chinese Character and it can works fine on Mac and Android device, when running on iOS device, It can show Chinese Character if I set it directly, but can not input by the soft keyboard. |
Also, the web export has the same issue. |
This seems to be an issue with keyboard suggestions. Or maybe But this doesn't really explain why web export has the same problem. @alexzheng do you have the same problem with current Godot's 3.2 branch or 3.2.4 beta release? Can you reproduce it with older iOS versions, like 13 or 12? |
godot 3.1.x 3.2.x |
Well, my guess was correct - to display keyboard's suggestion view, first responder have to implement |
@alexzheng any chance you could build and test this branch: naithar@74d5be7? |
@naithar It works now. |
another issue: for example, to input the Chinese Character "我“, type "wo", then select "我“ from the suggestion view, only the Chinese "我" should be input, however, the "wo" is also input, it can not be deleted. |
BTW, another issue related to keyboard is the the keyboard would popup unexpected. |
That's hardly related to this issue.
So "wo" should be simply replaced with Chinese character? |
Yes, admob Ads popup keyboard problem is not related to this issue, I just mention it since it seems like it is caused by the Godot Engine. not replace, The "wo" should not be input, when the Chinese candidate Character "我" is chosen, only “我” should be displayed in the LineEdit, but now the issue is it displayed "wo我", and the "wo" can not be deleted. |
@naithar: Tip: check how IME is handled on iOS. In a properly working IME, "wo" should be replaced with the character. |
Thanks for the info. I'll try to make it work correctly soon. |
I'm not really sure. |
It seems like your branch use ARC, so the admob module can not built. It may not popup by the function show_virtual_keyboard since no output message is printed in this function in debug build. The scene do not contain any input Control such as LineEdit to TextEdit. |
You can add a And catching |
I'm not sure if this is the correct way to add this flag the content of SCsub file of this module: #!/usr/bin/env python Import('env') env_admob = env_modules.Clone() sources = [ if (env["platform"] == "iphone"): It still failed to compile, so sorry for I can not reproduce the issue in your branch. |
For more info of this unexpected popup keyboard: Call hide_virtual_keyboard at the point of the banner refresh can stop the keyboard popup, Do this means the keyboard is triggered by the GLView of Godot? if the banner is not clicked, no popup when refresh. |
@alexzheng: This means it's most likely a problem with the admob addon. |
I've localy reverted ARKit to not use ARC and modified SCSub file to make it look like this:
Everything is working fine, so I guess you should report it to Edit: @alexzheng I've tried compiling master branch I would also suggest you try to debug an application with symbolic breakpoints so you can catch methods like And we should probably stick to issue from OP in this discussion :) |
This fix is a workaround, it just call [rootController.view endEditing:YES] to resigns first responder when the keyboard is about to popup. I have already did something like this to ignore this issue. The problem is when the ads is loaded, it should not cause the rootViewController popup keyboard, it is not required to hide the keyboard when ad is refreshing from the admob document. OK, too much discussion here, let's focus on the Chinese input issue |
A good news is it seems the keyboard popup issue have been fixed in your branch :) |
@alexzheng I've made some changes to my branch: naithar@890be81
That's good. But Godot changes might not be related, since |
That's related to your changes, I did not update my local admob module. Although the change in the admob module can just hide the keyboard. |
It could also be fixed by more earlier changes made for Let me know when you check this changes. I'll port them to |
It's too slow to download the zip file for the branch, did you only Changed the keyboard_input_view.mm compared to your first commit? I have test it by only update this file from this naithar/godot@74d5be7, it still have some problem. Can you try to type feichang and select 非常, then ganxieni and select 感谢你,the text should be 非常感谢你, but now is 感谢你 Only the pinyin for the Chinese should be replaced, the previously entered Chinese should not :) |
The reason for this is that for some reason iOS sometimes make some symbols count as 2 characters instead of one:
|
Can it behavior like the native textView? |
It does behave like native textView, since it's a native iOS |
Seems like |
Yes, the space between each pinyin for a Chinese Character is not reported, but we can notice it from the location of range, the textView in native app will insert a space automatically, and if you press the "确认" to accept the English, the space will be removed. That's a little complicated. |
naithar@05048bf this should fix some of the incorrect behavior, but I'm not really happy with this implementation. |
Yes, this is only a special behavior for Chinese Input, some other non-ascii languages may have their own special behavior, such as Japanese or Korean, I do not know these languages. |
@akien-mga any chance someone could explain how android handles keyboard input? |
@alexzheng you should probably create another issue with MRP for this :) |
I don't know if anyone is currently familiar with that code, but maybe @m4gr3d @pouleyKetchoupp or @RandomShaper have insights into how it works. As for IME for CJK specifically, @volzhs and @bruvzg both did work on this area, but I don't know if that's transferable to help with iOS specifically. |
OK, created #43438 |
@alexzheng have you tested naithar@05048bf branch? Is it working okay with Chinese keyboard now or it still have some issues? Edit: naithar@a0ad5cd made some more changes to the branch, hopefully if it's working correctly I can start refactoring it. |
@naithar There may many other traps in input, so it's may not a good idea to tweak the implementation for each specific behavior. What about trying to get text directly from the text property of the native textView? it has done all the tricks for each input method. |
Godot doesn't report caret/cursor position ( Edit: This seems to be the case with |
@alexzheng naithar@de73e0a this should do it, I guess. I've modified Since I've modified |
Godot version:
3.2.3
OS/device including version:
iOS 14.2
Issue description:
when try to input Chinese, nothing show up.
Steps to reproduce:
Minimal reproduction project:
The text was updated successfully, but these errors were encountered: