输入法编辑器(IME)程序设计(4)

类别:VC语言 点击:0 评论:0 推荐:

Candidate Lists

A candidate list is a CANDIDATELIST structure consisting of an array of strings that specifies the characters or character strings that the user may choose from. You can retrieve the candidate lists by using the ImmGetCandidateListCount and ImmGetCandidateList functions.

 

       备选列表是一个CANDIDATELIST结构,这个结构由一个列出用户可从中选取字符(例如汉字)或者字符串(例如词)的字符串数组组成。你可以用ImmGetCandidateListCountImmGetCandidateList函数来检索备选列表中。

 

Hot Keys

Hot keys give the user a way to quickly change the input mode of the IME or to switch to another IME. Although applications cannot add hot keys to the system, they can initiate the same action as a hot key by using the ImmSimulateHotKey function.

The HexToUnicode IME also permits conversion between hexadecimal and Unicode characters. For an explanation, see HexToUnicode IME.

 

       快捷键(热键)为用户提供了快速改变IME输入状态(例如中/文切换)或选择别的IME(例如从拼音换成五笔)的途径。尽管应用程序不能给系统添加快捷键,但是它可以通过使用ImmSimulateHotKey函数模仿快捷键效果,来启动相同的操作任务。

       HexToUnicode IME还允许十六进制字符与Unicode字符之间的转换。解释请参见HexToUnicode IME。

 

HexToUnicode IME

Rich Edit 3.0 supports the HexToUnicode IME, which allows a user to convert between hexadecimal and Unicode characters by using hot keys in one of two ways.

In the first method, the user types the character code in hexadecimal and then types ALT+X. The IME replaces the hexadecimal digits preceding the insertion point with the Unicode character. If the current font does not support the character code, an appropriate font is chosen that does support it. To convert from Unicode to hexadecimal, type SHIFT+ALT+X. This replaces the Unicode character that precedes the insertion point with the hexadecimal digits. In particular, this allows you to determine the character that is indicated by a "missing glyph" indicator. If the hexadecimal character code immediately follows some legitimate (noncharacter) hexadecimal characters, select the specific digits that you want to convert before typing ALT+X. A problem with this first method is that ALT+X is sometimes used as a key combination for the exit command (that is, eXit). For example, in Microsoft Office, this only happens as an option of the File menu.

The second method involves the number pad. Here the user types ALT+NumPad numbers (with values greater than 255) to enter Unicode characters using decimal values. This method is not as useful as the first method because you cannot see what hexadecimal digits you typed. Also, you cannot correct them except by reentering them all again.

 

       Rich Edit 3.0支持HexToUnicode IME,它允许用户使用快捷键通过一两个途径在十六进制字符和Unicode字符之间转换。

       第一个方法中,用户在十六进制模式下输入字符然后输入Alt+X键。IME会用Unicode字符取代插入点前的十六进制编码。如果当前字体不支持此字符的编码,则会选用一个能够支持它的合适字体。要将Unicode字符转换成十六进制字符,输入Shift+Alt+X键即可。这一操作会将插入点前的Unicode字符取代

为十六进制编码。特殊情况下,这一操作允许你自己决定由“缺失字形”指示符所指示的字符。如果十六进制字符代码后紧跟着某些十六进制非字符的代码,那么在输入Alt+X之前应该选择一个你想转换成的特殊字符。第一个方法的问题在于Alt+X往往被当做退出程序的组合键(也就是,eXit)来使用。例如,在Microsoft Office中,它将执行与File菜单中选项(退出选项)相同的功能。

       第二个方法涉及数字键盘。用户可以通过Alt+数字键盘数字(数字必须大于255)的方法用十进制值来输入Unicode字符。因为你看不见你输入的十六进制编码值,这个方法比起第一个方法就稍有逊色了。而且,对于更正而言,除了重新输入你别无选择。

 

本文地址:http://com.8s8s.com/it/it1107.htm