-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add IME Support for DX and XNA #32
base: master
Are you sure you want to change the base?
Conversation
Provide by ImeSharp Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Note that many Chinese mods that use forks of xna-cncnet-client have already shipped with IME support for about 2 or 3 years, to meet the huge need of numerous players. Thus I think we should merge this PR and thus officially provide IME support before releasing a stable release of xna-cncnet-client -- if not, these users might have to seek for an unstable release just in order to type words. |
@Rampastring I think the PR is ready to be reviewed. |
…lse start IME and incorrect IME position.
|
@linghengqian I don't think unit tests are helpful for windows UI related stuffs. Just waiting a review from the maintainer. |
There is a bug in IME, when i enter an error charactor in IME, if i backspace it, the charactor in IME and another in Textbox also be deleted. Even the backspace key sometimes doesn't work once need pressing it again. 你那个IME有个bug,如果输入错了某个字母,我退格,不仅输入法里的被删就连文本框里的也会被删,不知道什么原因 |
你可以检查一下打开的是不是 clientdx |
其他的不知道,我打开的一直是dx。还有一个问题,就是偶尔输入时会无响应然后卡崩,不过概率小,三天两头遇不到几回。 ClientCrashLog_2024_08_28_15_02.txt 顺带崩端的日志,使用的客户端是我的开源库。 |
就在刚刚我也出现了同样的打字无响应崩端的问题,但是我没有日志。我录了个视频表达我发现的bug:
2024-08-28.153306.mp4 |
@frg2089 @enderseven1 I have to remind both of you that GitHub is a place where discussions are made public. This means you should always use English regardless of whether both of you participants prefer discussion in another language or not. Think about 3rd party audiences who try to review the PR quality through your discussion. |
@SadPencil Okay, I understand. While i should use English but i need Chinese to read it easily. I can speak English and Chinese, but my English is bad. Can i use two languages at the same time? |
Yeah, I guess so. You can utilize AI to provides others an English translation in parallel with your Chinese text. |
The sender of this request and me are Chinese, it is ask for trouble if we talk in English. For example, I provide English translation in my first comment. But I really didn't take into account that this is a project with foreigners as the main contributors. So i'm sorry. I'll take notice. And this bug of IME will be fixed by a Chinese, so i think English may not too important in this time, but i will take English translation in my every comment after this. 主要是楼主跟俺都是中国的,咱俩互相讲英文这不没事找事吗?不过我第一个评论是用了中英并行,但我确实忘了这个项目以外国人的贡献为主,抱歉我会注意的。 我寻思这bug也是国人修,英语没那么重要吧,我以后会带英文翻译的... |
我看到了视频演示,你似乎在使用第三方输入法 English (Machine Translate by DeepL)I saw the video demo and you seem to be using a third party input method. |
试着在 Windows 设置中加回来呢? English (Machine Translate by DeepL)What about trying to add it back in Windows settings? |
我重装一下试试,目前的情况是微软拼音没有第一个bug,但是第二个bug仍然存在。第三个bug有点迷,几率产生,尚不明确。 2024-08-28.180936.mp4English (Translated by my brain)Now, the first bug that deletes text in textbox with IME has fixed. But the second bug that sends text when i press enter key with IME still be. Third bug I don't know yet, because it not happens eveytime. |
由于个人精力有限,这个PR只会处理微软输入法出现的问题 以及,我最近应该是没时间处理这些问题了,你如果感兴趣的话 可以看看 XNAControls/XNATextBox.cs 文件 English (Machine Translate by DeepL)Due to personal limitations, this PR will only deal with issues that arise with Microsoft's input methods. As well, I don't think I have time to deal with these issues lately, if you are interested, you can take a look at the XNAControls/XNATextBox.cs file. |
@frg2089 虽然说第三方输入法的问题换输入法就能解决,但是回车直接发送的bug必须得修啊,退格偶尔失灵的问题没什么大不了,但还是影响体验。 2024-08-28.234632.mp4English (Translate by Bing)Although the problem of the third-party input method can be solved by changing the input method,But the bug sent directly by the carriage enter must be repaired,The problem of occasional failure of backspace is not a big deal, But it still affects the experience. The situation that has been determined so far: backspace failure generally occurs when the client uses Textbox for the first time. Input methods that are not affected by the first bug (currently known): Microsoft Pinyin, Rime |
根据我更加深入的测试,退格失灵只会发生在每次启动第一次被使用的SuggestionTextBox中,也就是说每个SuggestionTextBox都会触发一次这个问题,不是说我触发了一次后面就都不会有,换一个SuggestionTextBox一样会有,只是每次启动只会出现一次,我起初怀疑是内容里混入了某个零宽字符导致退格无明显现象,但是键盘左右键否定了我的猜想。 English (Translate by Bing)According to my more in-depth testing, the backspace failure will only occur in the first time for a SuggestionTextBox that is used every time after the client is started, that is to say, each SuggestionTextBox will trigger this problem once, not that I will not have it after I trigger it once, but it will also occur with a different SuggestionTextBox, but it will only appear once per startup, I initially suspected that the content was mixed with a zero-width character that caused the backspace to be insignificant, but the left and right keys on the keyboard negate my conjecture. |
比如说局域网大厅的聊天框和房间里的地图搜索框都是SuggestionTextBox,它俩会各来一次。 English (Translate by Bing)For example, the chat box in the LAN lobby and the map search box in the room are both SuggestionTextBox, and they will each have this bug. |
Summary: |
fixed the backspace was not work on first time. Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Forgive me, my English is really bad, but this PR is so important that I had to use Microsoft Copilot to generate a paragraph describing its importance.
The addition of Input Method Editor (IME) support in this pull request is a significant enhancement for CJK (Chinese, Japanese, Korean) users.
It allows for seamless integration of native language input within the Rampastring.XNAUI framework, which is crucial for applications targeting audiences in these regions.
This improvement not only enhances user experience by facilitating easier text input in CJK characters but also broadens the accessibility of the application to a wider demographic, ensuring that CJK users can interact with the UI in their preferred language without barriers.
I have provided IME support for DX and XNA. However, it’s not possible to support GL as MonoGame does not offer an API to hook into the external SDL2 message loop.
Perfect IME support for DX and XNA (WinForms based).
IME support for GL (SDL2 based) to make it barely work.I dropped IME support for SDL2. Unless MonoGame provides support.
Reference #11
Code copied from ryancheung/MonoGame.IMEHelper.
new package reference ImeSharp (for WinForms base).