天天看點

輸入法編輯器(IME)程式設計(4)

<b>Candidate Lists</b>

<b></b>

A candidate list is a <b>CANDIDATELIST</b> 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 <b>ImmGetCandidateListCount</b> and <b>ImmGetCandidateList</b> functions.

       備選清單是一個<b>CANDIDATELIST</b>結構,這個結構由一個列出使用者可從中選取字元(例如漢字)或者字元串(例如詞)的字元串數組組成。你可以用<b>ImmGetCandidateListCount</b> 和<b>ImmGetCandidateList</b>函數來檢索備選清單中。

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 <b>ImmSimulateHotKey</b> function.

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

       快捷鍵(熱鍵)為使用者提供了快速改變IME輸入狀态(例如中/文切換)或選擇别的IME(例如從拼音換成五筆)的途徑。盡管應用程式不能給系統添加快捷鍵,但是它可以通過使用<b>ImmSimulateHotKey</b>函數模仿快捷鍵效果,來啟動相同的操作任務。

       HexToUnicode IME還允許十六進制字元與Unicode字元之間的轉換。解釋請參見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字元。因為你看不見你輸入的十六進制編碼值,這個方法比起第一個方法就稍有遜色了。而且,對于更正而言,除了重新輸入你别無選擇。

本文轉自 水之真谛 51CTO部落格,原文連結:http://blog.51cto.com/liutiemeng/18883,如需轉載請自行聯系原作者

繼續閱讀