通过触摸屏键盘输入拼音字符

发布于 2024-07-27 19:15:15 字数 665 浏览 1 评论 0原文

我正在开发的应用程序要求将其部署在中国,这意味着它需要具有拼音和汉字处理功能。 据我所知,我们的客户处理字符输入的方式如下:

  • 输入拼音字符,例如“zhang”
  • 当他们输入字符时,会向用户呈现可能的中文(普通话?)字符列表,例如:

拼音字符

  • 然后用户将选择“1”输入粗略翻译为“的姓氏”我

怎样才能将这样的程序(我相信有一个来自微软的名为“mspy.exe”的程序,我相信它随微软版本的 XP 一起提供)挂接到 WPF 文本框中? 现在,用户可以使用键盘或屏幕键盘输入文本,因此我可能需要从任一源捕获按键事件并将其提供给某些操作系统事件或 MSPY.exe 或一些类似的程序。

或者有其他方法可以输入拼音并将其转换为普通话吗? 除了 MSPY 之外还有其他程序我应该看吗?

编辑:对于那些认为这应该“有效”的人来说,事实并非如此。 如果在记事本或开始->运行菜单或其他任何地方输入文本,中文字符输入就可以正常工作,但在 WPF 中则不起作用。 这就是这个问题的关键:如何启用WPF条目? 有谷歌拼音和搜狗拼音,但网站是普通话或中文或类似的语言,我看不懂这种语言。

The app I'm developing requires that it be deployed in China, which means that it needs to have Pinyin and Chinese character handling. I'm told that the way that our customers handle character entry is like so:

  • Enter in the pinyin character, like 'zhang'
  • As they enter the characters, a list of possible Chinese (Mandarin?) characters are presented to the user, like:

pinyin characters

  • The user will then select '1' to enter the family name that is roughly translated to 'zhang'

How can I hook such programs (I believe one is called 'mspy.exe', from Microsoft, which I'm lead to believe comes with Microsoft versions of XP) into a WPF text box? Right now, the user can enter text either by using their keyboard or by using an on-screen keyboard, so I will probably need to capture the event of a keypress from either source and feed it to some OS event or to MSPY.exe or some similar program.

Or is there some other way to enter pinyin and have it converted to Mandarin? Is there a program other than MSPY I should look at?

EDIT: For those of you who think that this should 'just work', it does not. Chinese character entry will work just fine if entering text into notepad or the start->run menu or whatever, but it will not work in WPF. That's the key to this question: how do I enable WPF entry? There's the Google Pinyin and Sogou pinyin, but the websites are in Mandarin or Chinese or something similar and I don't read the language.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

偏爱自由 2024-08-03 19:15:15

如果用户选择中文输入法,系统很可能会自动处理此问题。 尝试实现自己的系统来处理中文文本可能是一个坏主意。

当然,在部署之前一定要在中文版 XP 上对其进行测试,但无论如何,WPF 和 XP 作为一个整体都需要有足够的设计; 它应该可以工作。

In all likelihood the system will handle this automagically if a Chinese input method is selected by the user. Trying to implement your own system for dealing with Chinese text is probably a bad idea.

Be sure to test it on a Chinese version of XP before deploying, of course, but with any amount of decent design in WPF, and XP as a whole, at all; it should Just Work.

空心空情空意 2024-08-03 19:15:15

这并不是您问题的真正答案,但据我所知,这是由操作系统处理的,我不确定应用程序是否真的对它有那么多的控制权。

以下是有关如何在 Windows XP 中启用拼音汉字输入的指南:

Not really an answer to your question, but as far as I know, this is handled by the operating system, and I'm not sure that application really have that much control over it.

Here's a guide on how you enable pin yin Chinese character entry in Windows XP:

小糖芽 2024-08-03 19:15:15

我的应用程序支持中文输入,并且使用 WPF,我不明白你想问什么。
您可以使用搜狗拼音或微软拼音在 WPF 文本框中输入中文文本。 在xp和win7下测试过

只是因为你的ime设置为英文输入。
如果使用搜狗拼音,短按一次shift,你会看到“一”字变成“中”
那时您将能够输入中文;-)

另外,文本框上有 IME 属性,选择将其打开,否则 IME 将处于“英语模式”

My application works with chinese input, and it is using WPF, i don't get what you want to ask.
You can input chinese text in a WPF textbox using sogou pinyin, or microsoft pinyin. Tested in xp and win7

It is just because your ime is setted to input in english.
Press shift once briefly if using sogou pinyin and you will see the hanzi of "yi" become "zhong"
At that point you will be able to type in chinese ;-)

Also, there are IME property on textboxes, select to have it On, otherwise the IME will be in "english mode"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文