你如何使用输入法? [英] how do you use IME?

查看:39
本文介绍了你如何使用输入法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做一个处理用户输入的控件,所以我希望能够处理不同的键盘,其中一种方法是使用 IME.

如果您不处理它,当您启用 IME(例如启用日语书写)时,会出现一个浮动窗口.我找到了需要处理的消息,但我不知道如何将我捕获的密钥发送到 IME,以及何时才能获得有效的转换字符.

解决方案

我是 Microsoft SDE,曾经维护(Windows 和 Office)韩语 IME 一段时间...>

不幸的是,最好的 IME API 文档是由非 Microsoft 站点提供的:

<小时>

这里是微软官方文档:输入法管理器(MSDN)

还有一个基于文本服务框架 (TSF) 的新的、更高级的 IME,Microsoft 希望您使用它,但它更加复杂,并且可以很好地模拟旧 API.如果您不需要任何高级功能(例如通过平板电脑/语音识别/高级 IME/等输入),那么使用旧 API 就足够了.

关于文本服务框架的最佳文档是由另一位 Microsoft 开发人员编写的 TSF Aware 博客.如果你走这条路,埃里克·布朗甚至可以亲自回答你的问题.

以下是 TSF 的 Microsoft 官方文档:Text服务框架 (MSDN)

您可能会发现 TSF 的一项有用功能是能够抑制 IME 的呈现(例如,需要自己呈现 IME 的全屏游戏).只需告诉 TSF 您的应用程序将呈现 IME GUI,然后实现一个空的呈现方法:UILess 模式概述 (MSDN)

I want to make a control that handles user input, so I want to be able to handle different keyboards, and one of the ways is using IME.

If you don't handle it, there is a floating window that appears when you have IME active (for example japanese writing active). I found the messages that needs to be taken care of, but I don't know how to send the keys I'm trapping to the IME and when do I get a valid converted char.

解决方案

I'm a Microsoft SDE that used to maintain the (Windows and Office) Korean IME for a while...

Unfortunately the best IME API documentation is provided by non-Microsoft sites:


Here is the official Microsoft documentation: Input Method Manager (MSDN)

There is also a new, more advanced IME based on the Text Services Framework (TSF) that Microsoft would prefer you to use, but it's even more complicated and the old API is emulated pretty well. If you don't need any of the advanced features (like input via tablet/voice recognition/fancier IME/etc) then using the old API is sufficient.

The best documentation on the Text Services Framework is the TSF Aware Blog written by another Microsoft dev. Eric Brown may even personally answer your questions if you go this route.

Here is the official Microsoft documentation for TSF: Text Services Framework (MSDN)

One feature of TSF you may find useful is the ability to suppress rendering of the IME (needed for full screen games that need to render the IME themselves, for example). Simply tell TSF that your app will render the IME GUI, then implement an empty rendering method: UILess Mode Overview (MSDN)

这篇关于你如何使用输入法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆