頭一次發譯的東西,肯定會有不少錯誤,請大家多多斧正。
本人志在編寫中國最出色的IME,解放中國人的雙手。
今從零起步,朝成夕可死也。
Input Method Editor
An input method editor (IME) is a program that allows computer users to enter complex characters and symbols, such as Japanese Kanji characters, by using a standard keyboard.
輸入法(IME)是一個程式,這個程式允許電腦使用者使用標準鍵盤就能輸入複雜的字元與符號,例如日文中的漢字(嚴重反對!中文是世界上使用人口最多的文字,這裡應該是中文才好!)字元。
This overview describes the IME and explains how to use the input method manager functions to create and manage IME windows.
- About Input Method Editor
- Using Input Method Editor
- Input Method Editor Reference
本預覽描述了IME,並且解釋說明了如何使用IME管理程式(IMM)函數來建立和管理IME視窗。
¨ 關於輸入法
¨ 使用輸入法
¨ 輸入法參考
About Input Method Editor
The input method editor relieves users of the need to remember all possible character values. Instead, the IME monitors the user's keystrokes, anticipates the characters the user may want, and presents a list of candidate characters from which to choose.
輸入法減輕了使用者記住所有可能字元值的需要,取而代之,IME監控使用者的擊鍵、預見使用者可能期望的字元,並且提供一個可選字元的列表,使用者可以從中選擇想要的字元。
By default, the IME provides an IME window through which users enter keystrokes and view and select candidates. Applications can use the input method manager (IMM) functions and messages to create and manage their own IME windows, providing a custom interface while using the conversion capabilities of the IME.
預設情況下,IME提供了一個IME視窗,通過這個視窗,使用者可以用鍵盤輸入並且查看和選擇想要的字元。應用程式可以使用IME管理器(IMM)函數和訊息來建立並且管理其自己的IME視窗(比如QQ裡是五筆而Word裡卻是拼音),並在使用IME的轉換功能時提供一個自訂介面(不太明白)。
IMM is only enabled on East Asian (Chinese, Japanese, Korean) localized Windows. On these systems, call GetSystemMetrics with SM_DBCSENABLED to determine if IMM is enabled. Note that Windows 2000 provides full-featured IME support in all localized language versions, however, that IMM is enabled only when an Asian language pack is installed. An IME-enabled application can call GetSystemMetrics with SM_IMMENABLED to determine if IMM is enabled.
IMM只在東亞(中國,日本,韓國)本地化的Windows中才可用。在這些系統中,以SM_DBCSENABLED訊息調用GetSystemMetrics函數來確定IMM是否可用。注意,Windows 2000在所有語言版本中都提供了全功能的IME支援,然而僅在安裝了亞洲語言套件的時候IMM才可用。一個IME-enabled(IME可用)的程式會以SM_IMMENABLED調用GetSystemMetrics函數來確定IMM是否可用。
Status, Composition, and Candidates Windows
The status, composition, and candidates windows form the user interface for the IME. The status window indicates that the IME is open and provides the user the means to set the conversion modes. The composition window appears when the user enters text and, depending on the conversion mode, either displays the text as entered or displays converted text. The candidates window appears in conjunction with the composition window. It contains a list of "candidates" (alternative characters) for the selected character or characters in the composition window. The user can scroll through the candidates list and select the desired characters, then return to the composition window. The user can compose the desired text in this way until the composition string is finalized and the window is closed. The IME sends the composed characters to the application in the form of WM_IME_CHAR or WM_IME_COMPOSITION/GCS_RESULT messages. If the application does not process these messages, the DefWindowProc function translates them into one or more WM_CHAR messages.
狀態視窗、字母組合視窗和列選視窗構成了IME的使用者介面。狀態視窗指示出IME處於開啟狀態並且提供給使用者佈建轉換模式的方法。字母組合視窗會在使用者輸入字元的時候出現,其形式基於轉換模式,同時顯示已經輸入的字母或者是已經轉換了的字元。(conversion mode轉換模式=IME,比如微軟拼音、五筆字型……其實不同的IME的本質是不同的轉換規則。)列選視窗會緊挨著字母組合視窗顯示。它包含了一個由“候選條目”構成的列表,此列表匹配選中字元或者是字母組合視窗中的字元。使用者可以滾動列選視窗並且選擇想要的字元,然後(焦點)返回到字母組合視窗。藉此使用者可以組合想要的文本直到字元組合成的字串結束,視窗會關閉。IME將使用WM_IME_CHAR或 WM_IME_COMPOSITION/GCS_RESULT訊息把組合好的字元發送給表單中的應用程式。如果應用程式沒有處理這些訊息,DefWindowProc函數會把它們翻譯成一條或多條WM_CHAR訊息。
By default, the system automatically creates and manages status, composition, and candidates windows for all windows that require text input. For many applications, this default processing is sufficient. These applications rely entirely on the system for IME support and are said to be IME-unaware because they are unaware of the many tasks the system carries out to manage the IME windows.
預設情況下,系統會為所有要求輸入文本的視窗自動產生並管理狀態視窗、字母組合視窗和列選視窗。對於許多程式,這一預設處理已經足夠了。這些完全依賴於系統提供IME支援的應用程式稱為IME-unaware(IME無感知)程式,原因在於它們對系統為管理IME視窗所完成的諸多任務毫無感覺。
An IME-aware application, on the other hand, participates in the creation and management of IME windows. Such applications control the operation, position, and appearance of the default windows by sending messages to and by intercepting and processing messages intended for these windows. In some cases, applications create their own IME windows and provide complete processing for their custom status, composition and candidates windows.
相反,一個IME-aware(IME感知)程式會參與IME視窗的建立與管理。例如程式可能通過發送或截取訊息並且有目的地對這些(IME)視窗訊息進行處理,來控制預設(IME)視窗的選項、位置和外觀。有些情況下,應用程式會建立它們自己的IME視窗並且對其自訂的狀態、字母組合和列選視窗提供完全的控制處理。