═══ 1. Preface ═══ OS/2 32 bit Input Method Final Programming Functional Specifications Release 1.0 Issued by Kenji Kawasaki Prepared by Naoto Satoh, Shiro Sakamoto, Takeshi Itoh, Nobuhiro Sugimasa Advanced Operating System & Extentions, LAB-R35 Yamato, IBM Japan Ltd. 1623-14, Shimotsuruma, Yamato-shi, Kanagawa-ken, JAPAN August 30, 1996 The new IM is designed that IME can easily make up their own User Interface. Reference - OS/2 WARP CP Programming Guide, G25H-7101 (GB88-5593) - OS/2 WARP CP Programming Reference, G25H-7102 (GB88-5605) - OS/2 WARP PM Basic Programming Guide, G25H-7103 (GB88-5594) - OS/2 WARP PM Advanced Programming Guide, G25H-7104 (GB88-5595) - OS/2 WARP PM Programming Ref Vol I, G25H-7190 (GB88-5600) - OS/2 WARP PM Programming Ref Vol II, G25H-7191 (GB88-5610) - OS/2 WARP GPI Programming Guide, G25H-7106 (GB88-5606) - OS/2 WARP GPI Programming Ref, G25H-7107 (GB88-5607) - OS/2 DBCS Version 2.0 IME Specification Revision 2.11 (5/16/1994) - OS/2 DBCS Version 2.0 IMP Specification Revision 2.0 (8/29/1995) History - 01/03/96 Prepares as IPFS - 07/07/96 Prepares as FPFS Release 0.9 - 08/30/96 Prepares as FPFS Release 1.0 - 10/22/96 Prepares as FPFS Release 1.01 (Warp 4 GM ) Comparison Table between OS/2 and Windows95 ┌─────────────────────────┬─────────────────────────┐ │OS/2 │Windows95 │ ├─────────────────────────┼─────────────────────────┤ │IM Window │IME Window │ ├─────────────────────────┼─────────────────────────┤ │IME Window │UI Window │ ├─────────────────────────┼─────────────────────────┤ │IMC_xxx (WM_IMECONTROL) │ IMC_xxx (WM_IME_CONTROL)│ ├─────────────────────────┼─────────────────────────┤ │IMR_xxx (WM_IMEREQUEST) │ IMN_xxx (WM_IME_NOTIFY) │ └─────────────────────────┴─────────────────────────┘ Comparison with Win95 APIs Messages Comparison with Windows 95 Terminology IME Functions Messages IM Functions for IME ═══ 2. IM Module ═══ The following figure describes the position of IM module. 1. KBD DD generates KBD event and pass the KBD event to PMWIN. 2. PMWIN pass KBD event to IM. PMWIN notifies some events (focus change, codepage change, etc.) to IM. 3. IM pass KBD event to IME. IM notifies some event (input mode change, etc.) to IME by ImeNotifyEvent (IME_NE_KEYEVENT). 4. IME requests IM to display some IM information (conversion string, input mode, candidate window, etc.) by ImRequestEvent. IME informs IM that some result string is generated by ImRequestEvent. 5. IM informs the change of IM status to the application window procedure. 6. An application may pass back the information to IM via WinDefWindowProc. 7. IM requests Part Class to display the IM status information. 8. IM requests PMWIN to change translation table. IM returns the result string to PMWIN. 9. PMWIN pass KBD event and result string to an application. 10. An application can control IM. An application can request string conversion By ImXxx. At the IM input model, all key event is processed in the application thread context. Application There are three levels in the IM support level of the application. - Level 1 Application The application does not know the IM. The application does not communicate with any IM module. When the application may use the system control window class (ex. single edit field), the user can perform on-the-spot-conversion on the window. - Level 2 Application The application provides the information of the conversion to the IM system. The applcation can specify the position and font information of the conversion window. The application can control the IM mode such as IM mode on/off. - Level 3 Application The application can control the IM system such as the level 2 applcation. Additionally the applcation gets the information of the conversion from the IM system. The application can display the conversion string in the application window by getting the conversion information from the IM system. The application can get the result string from the IM system by using IM API, not from PMWIN's WinGetMsg. The application can convert the string without the IME's displaying by ImConvertString API. PMWIN PMWIN gives the keyboard event to IM module. IM module gives back the translated characters to PMWIN when IME generates the translated characters from the keyboard event given by PMWIN. Finally PMWIN gives the keyboard event and the translated characters to the Application by returning of WinGetMsg. KBD DD KBD DD generates the keyboard event from the keyboard hardware interrupt. The keyboard event is queued into the PMWIN system queue. Part Class The IME vendor can provide the unique user interface. When the IME provides the name of IME window at ImeInitialize, the system (IM window) forwards the messages related to user interface to the IME window. The IME window can dispatch the messages to the IME unique Part Class window. The system provides the some default Part Classes. The IME can use the default Part Class if IME does not need the unique user interface. The detail is described in "Default IM Classes" section. IME The IME generates the translated characters from the keyboard events. When the IME needs to display the candidate string, the IME should request the system to generate the user interface messages for the IME window in order that the application can interc ept the user interface messages. The IME receives the key event conforming to PM SPEC. The key event has the IME virtual key as the additional information. The IME virtual keys are defined to all keys including the alphabet keys. IM The IM system is the extension module of PMWIN for the DBCS conversion support. The IM system gets the keyboard event from PMWIN. The IM system pass the keyboard event to the current IME. The IM system provides the helper IM API for the IME module. The IM syetm is described as following figure: The IM module can be decomposed into following: 1. IM Interface (API) The IM interface has the external API. The IM interface dispatches the API to other components. 2. Message Manager The Message Manager translates the WM_IMECONTROL message to the IM APIs. 3. Instance Manager This manages IM instance and IM Part instance. 4. KBD Resource Manager The KBD Resource Manager manages the translation tables. The KBD Resource Manager handles the keyboard event and requests PMWIN to change the translation table. 5. IME Manager This is the interface component to IME. This component calls the APIs exported by the IME module. The IME Manager manages the list of the installed IMEs. 6. Display Service Manager The Display Server Manager manages the address of the display handler per IM instance. 7. IM Window The IM window is the interface window to the application. The application can send WM_IMECONTROL message to the IM window in order to control the IME. The IM window gets back the IM related messages from the application when the application calls ImIsIMEM essage or WinDefWindowProc. 8. Default IM Classes The IM system provides the following pre-defined IM window classes. - Default IME Window Class - WC_IME_CONVERSION - WC_IME_STATUS - WC_IME_CANDIDATE - WC_IME_INFOMSG - WC_IME_REGWORD The function detail of the default IM Classes is described in "32 bit Input Method Editor Interface" section. 9. Installation / Registration This manages IME registration. In order that a IME can be used at OS/2 system, the IME must be installed into OS/2 system. ═══ 3. Control Flow ═══ Control Flow of Window Creation 1. WinCreateWindow 2. Inform of Window Creation 3. Request of Instance Creation 4. Create IM Window 5. Request of IME loading 6. Get Current IME 7. Load IME 8. Setup Dispatch Address 9. Request of Mode Change Control Flow of Keyboard Event Control Flow of FullScreen and DOS Session General Message Flow The root of the general message is described as blow. 1. WM_IMECONTROL 2. Im Api 3. ImeNotifyEvent 4. ImRequestEvent 5. WM_IMEREQUEST At WIN95, the application does not receive the WM_IME_NOTIFY (IMN_OPENSTATUSWINDOW) message when the application sends the WM_IME_CONTROL (IMC_OPENSTATUSWINDOW) to the IME window. At new IM, the application receives the WM_IMEREQUEST (IMR_OPENSTATUSWINDOW) message when the application sends the WM_IMECONTROL (IMC_OPENSTATUSWINDOW) to the IM window. Sample of Message Flow 1. An Application sends the WM_IMECONTROL (IMC_SETCONVERSIONWINDOWPOS) to IM Window. 2. IM Window calls ImSetConversionWindowPos which is API of IM. 3. IM calls ImeNotifyEvent (IME_NE_INSTANCEUPDATED, IME_NE_IU_CONVERSIONPOS). 4. IME calls ImRequestEvent (IMR_CONVERSION, IMR_CONV_CONVERSIONPOS). 5. IM generates WM_IMEREQUEST (IMR_CONVERSION, IMR_CONV_CONVERSIONPOS) and sends it to an application window which has focus. 6. The application window pass WM_IMEREQUEST (IMR_CONVERSION, IMR_CONV_CONVERSIONPOS) to WinDefWindowProc if the application does not handle the message. 7. WinDefWindowProc sends WM_IMEREQUEST (IMR_CONVERSION, IMR_CONV_CONVERSIONPOS) to IM window. 8. IM window sends WM_IMEREQUEST (IMR_CONVERSION, IMR_CONV_CONVERSIONPOS) to IME window. 9. IME window sends WM_IMEREQUEST (IMR_CONVERSION, IMR_CONV_CONVERSIONPOS) to conversion window. ImIsIMEMessage The IME unaware application may pass the IME messages to WinDefWindowProc. The messages are forwarded to the IM window. The IME aware application can use ImIsIMEMessage to forward the IME messages to IM window. The application can check that the message is handled by IM window. Result Part Handling Level 1 Application and Level 2 Application Level 3 Application Level 1 Application and Level 2 Application 1. ImRequestEvent 2. WM_IMEREQUEST (IMR_??) 3. WinDefWindowProc 4. IM Window call IM 5. WinPourMessage 6. WinGetMsg Level 3 Application 1. ImRequestEvent 2. WM_IMEREQUEST (IMR_??) 3. ImQueryResultString (Application gets result string for IM instance) ═══ 4. Handling of Display Service ═══ figure ═══ 5. Install ═══ Language PM Installation Fullscreen Installation DOS Installation IMP consideration Language The new IM is installed with language list. At this version the languages listed below can be acceptable: - JA - EN This language is IM system unique language system, as the general language module (ULS) may not be available at Merlin time frame. When the general language mechanism becomes available, the IM system unique language system will be migrated to the general language mechanism. IM has the static table between language and codepages at current version. For example: ┌────────────────────┬──────────────────────────────┐ │Language │codepage │ ├────────────────────┼──────────────────────────────┤ │JA │932 942 943 │ ├────────────────────┼──────────────────────────────┤ │EN │437 850 │ └────────────────────┴──────────────────────────────┘ Note: Though 850 is multilingual codepage, we maps codepage 850 to English language (EN). Because current user of IM is DBCS country and the static mapping will be removed when the general language mechanism is introduced into OS/2 system. PM Installation IM Setting object has following panels. The User Interface of IME Installation is same as current PM installation. The setting panel of default IME is changed to select the default IME per language. The setting panel of switch key definition is added newly. Fullscreen Installation As IMMON will be modified to support new IME which is installed by IM interface ImRegisterIME, IME does not need additional work for Fullscreen installation. At new IM, the fullsceen installation is not supported. The IME can not provide the IME unique user interface at Fullscreen session. DOS Installation IM System supports the routing mechanism that the DOS IME event is mapped to IM Interface. If IME want to support the IME unique User Interface at DOS session, IME need to install stub module additionally by using the VIMM mechanism. Please refer to "DOS Support" section for the detail of the VIMM mechanism. IMP consideration In order to keep the 16 bit IME interface, the legacy IMP interface is kept as is. The IMP interface is routed to the IME listing mechanism of the IM system. ═══ 6. 16 bit IME Support ═══ The IM system provides the mapping layer named GTO (Glue of Thunk Operation) as following. The GTO uses the default part class as the user interface window. User Interface Consideration The 16 bit IME has some unique User Interface Dialog. The system does not prevent the 16 bit IME from displaying the unique UI Dialog. ═══ 7. Fullscreen Support ═══ The following shows how IM works with OS/2 Fullscreen Input stuffs quite simply: To adapt to the new IM32 model, OS/2 Fullscreen Input stuffs need to be modified to work with its new I/F. The above chart only shows two Fullscreen Input stuffs, i.e. IMMON and XIMACALL, but the following modules are also needed to modify. IMREGIST.EXE - request SesMgr to notify a session change IMDAEMON.DLL - open an Input Method Service for each session XDSCALL.DLL - handle IME display requests XIMACALL.DLL - communicate with the IM to handle keyboard inputs IMMON.EXE - notify XIMACALL of each keyboard events In OS/2 Fullscreen, the current IM16 will be able to co-exist with the new IM32. So, the original (current IM16 support) codes must not be disabled. And they should be utilized to support the new IM32 as much as they can. Their modification should be minimized. The following sections explain how the IM32 works in OS/2 Fullscreen environment at several situations. Initialization In order to get session related events, during system IPL, IMREGIST.EXE registers IMDAEMON.DLL to SessionManager. Currently IMDAEMON gets Session Creation and Termination notifications. In addition to this, under IM32, IMDAEMON needs to know the Session Change notification. To get the new notification, IMREGIST.EXE will added a new notification type for the session change in the request block using DosSMRegisterDD API. Session Creation IMDAEMON.DLL is registered for getting the session related events. At session creation, it is called by SessionManager, initializes its internal data for a new session and loads the IMMON for the session. During this process, IMDAEMON calls ImOpenService API (IM private) to open a new Input Method Service for the session. As the return of this API, it gets a new handle, hIMS and stores it until session termination for subsequent IM32 requests. The hIMS is then passed to the newly loaded IMMON through IMMonInit API. For this, the request block of IMMonInit is needed to modify as follows: struct MonInitBlock { USHORT len_minit; struct KKMonCmd *pKKMonCmd; HIMS hIMS; // IM32 IMS Handle } The IMMON loaded by IMMonInstall from IMDAEMON initializes its private data area and open a new service from XIMACALL with XimaOpen API. For subsequent IM32 requests, XIMACALL should know the IMS handle for this IMMON (or session). So, the request block of XimaOpen is also needed to modify like below: typedef struct { USHORT Length; // Block Length USHORT XimaHandle; // Xima Handle UCHAR SGNum; // Screen Group Number UCHAR XimaEnv; // Environment type of caller HSEM GiveSem; // syncro between XIMA/IMMON HSEM TakeSem; // HIMS hIMS; // IM32 IMS Handle } XIMA_OPEN_BLK, //::::: Environment type of caller (XimaEnv) ::::: #define OS2_FULL_SCREEN 0 #define DOS_FULL_SCREEN 1 #define DOS_WINDOWED 2 #define IM32_MODE 128 // addition to original values XIMACALL calls ImSendEvent with the event, IM_OPENSESSION, in XimaOpen API. Now, IM32 (i.e.OS2IM.DLL) knows a new Fullscreen session is opened and prepares a new default IM Instance for the session (or hIMS). Then, XIMACALL subsequently calls ImQuerySessionDefInstance API to get the newly created IM Instance, i.e. hIMI, within XimaOpen. With this hIMI, XIMACALL registers its API entry point to the IM32 using DsmRegisterFunc API. The registered API entry then will be called by the IM32 whenever IM/IME related events occurs, e.g. request to display conversion strings. Session Switch At session switch, IMDAEMON is called by Session Manager and just notifies the IM32 of the event happened. This notification is passed by ImSendEvent with the event, IM_CHANGESESSION. Session Termination IMDAEMON gets a notification from Session Manager when the opened session is about to terminate. With this notification, IMDAEMON calls IMMonDeinstall API internally and deinstalls the loaded IMMON from the session. As the result of this call, the IMMON receives the command, CMD_IMMONDEINSTALL and terminates by itself. Then, its Signal Handler gets control and within the handler, it calls XimaClose API. XIMACALL releases all allocated resources for this IMMON (or session) with XimaClose. It also deregisters the IM32 worker routine by DsmDeregisterFunc with the stored hIMI. (The hIMI can be also retrieved through ImQuerySessionDefInstance.) Then, to no tify the IM32 of the session termination, it calls ImSendEvent with the event, IM_CLOSESESSION. After IMMonDeinstall API returns, IMDAEMON calls ImCloseService to release the IMS handle assigned for the session. Keyboard Input IMMON is a usual Keyboard monitor process. It registers itself into the keyboard monitor chain, reads keyboard packets from the chain, processes the packets and finally writes them back to the chain. So, applications can get the processed keyboard packe ts naturally. In the current IM16 model, when IMMON receives the Keyboard packet, it is passed to XIMACALL through both XimaPreConv and XimaConv APIs. XimaPreConv translates the keyboard scan code to ASCII character code including DBCS characters and Roman conversion service. Then, XimaConv converts the translated characters to linguistical strings using IME. Under the new IM32 model, when IMMON calls XimaPreConv, XIMACALLS converts the input packet to the IMCHARINFO (of OS2IM) format and calls ImSendEvent with the event, IM_CHAR. The further requests, e.g. display candidate list, are passed to the IM32 worker routine in XIMACALL registered at session creation. CodePage Change When a codepage (keyboard codepage) is changed, the Physical Keyboard Device Driver (PKBD) sends a specific keyboard monitor packet out to the keyboard monitor chain. IMMON can know the new codepage from this packet and sets it to XIMACALL by XimaSetCp A PI. XIMACALL then calls ImSendEvent with the event, IM_CHANGECP to notify the IM32 of the new code page. Keyboard Mode Change In case of OS/2 Fullscreen session, keyboard modes are handled and managed by PKBD. For example, IMMON receives NLS Mode key packet, e.g. Hiragana in Japan, with NLS mode has been set. This means IMMON doesn't need to manipulate the keyboard modes at all. However, in order to notify the IM32 of the current or updated keyboard modes, IMMON, actually XIMACALL has to look at each keyboard packet, and once it changes the mode, it calls ImSetIMMode API with the updated mode. This notification has to be made fo r not only physical mode change, but also software mode change request. IM16 support The new OS/2 Fullscreen Input stuffs support both the current IM16 and the new IM32 models. In case of IME16 selected, they just work as the current implementation, that is, they might not call the IM32 for the most of their processings. When IME32 is l oaded, they cooperate with the IM32 (i.e.OS2IM) as much as they could. Free PS Support (Setting Dialog) The IME32s can not display their dialogues in OS/2 Fullscreen environment, as IM system does not support the Free PS (like) Interface. If the IME32 needs to display their dialogues, the IME32 should support Legacy IME16 interface and register with IM_REGF LAG_IME16CALLABLE bit. ═══ 8. DOS Support ═══ VIMM Mechanism At OS/2 Warp, the shared mode DOS IM device drivers ($ias.sys, iaestub.sys) are described in DOS_DEVICE section in DOS setting. At the IM system, the VIMM (Virtual Input Method Manager) installs the DOS IM device drivers. - VIMM This is virtual device driver for IM32. This driver receives the IAE request from IAE4IM.SYS by using VDHRegisterAPI. - IMBRIDGE This is the bridge module between VDM session and OS/2 protect mode. - IAE4IM The IAE4IM.SYS is the default IAE stub module. The module pass the IAE request to VIMM. PM_FEP for IM PM_FEP is not supported at the IM system. At OS/2 Warp, there is PM_FEP in DOS_FEP mode. At the IM system, PM_FEP is removed from DOS_FEP mode. PM_FEP for IME16 PM_FEP is not supported. OS2_FS_FEP for IM The following shows how IM works with DOS Fullscreen Input stuffs quite simply: To adapt to the new IM32 model, DOS Fullscreen Input stuffs need to be modified to work with its new I/F. The above chart only shows two Fullscreen Input stuffs, i.e. VDMIMFEP and XIMACALL, but the following modules are also needed to modify, in addition to OS/2 Fullscreen support: VKBD.SYS - notify a CodePage Change event XIMACALL.DLL - communicate with the IM to handle keyboard inputs VDMIMFEP.EXE - notify XIMACALL of each keyboard events In DOS Fullscreen, the current IM16 will be able to co-exist with the new IM32. So, the original (current IM16 support) codes must not be disabled. And they should be utilized to support the new IM32 as much as they can. Their modification should be mi nimized. The subsequent sections explain how the IM32 works in DOS Fullscreen environment at several situations. Initialization The initialization for the IM32 is pretty done by the OS/2 Fullscreen Input stuff, IMREGIST.EXE, so that there is no additional initialization required for DOS support. Session Creation IMDAEMON.DLL is registered for getting the session related events. At first DOS session creation, it loads VDMIMFEP for DOS Fullscreen Input handling. Once VDMIMFEP is loaded, it establishes a communication path to Virtual Keyboard Device Driver (VKBD) with DosRequestVDD for further event notifications. Then, VKBD sends the event, VKBDEVENT_CREATE out to VDMIMFEP. During this process, VDMIMFEP calls ImOpenService API (IM private) to open a new Input Method Service for the session. As the return of this API, it gets a new handle, hIMS and stores it unti l session termination for further IM32 requests. VDMIMFEP initializes its private data area and open a new service from XIMACALL with XimaOpen API. For subsequent IM32 requests, XIMACALL should know the IMS handle for this DOS session. So, the request block of XimaOpen is also needed to modify. The m odified block is shown in OS/2 Fullscreen Support. XIMACALL calls ImSendEvent with the event, IM_OPENSESSION, in XimaOpen API. Now, IM32 (i.e.OS2IM.DLL) knows a new Fullscreen session is opened and prepares a new default IM Instance for the session (or hIMS). Then, XIMACALL subsequently calls ImQuerySessionDefInstance API to get the newly created IM Instance, i.e. hIMI, within XimaOpen. With this hIMI, XIMACALL registers its API entry point to the IM32 using DsmRegisterFunc API. The registered API entry then will be called by the IM32 whenever IM/IME related events occurs, e.g. request to display conversion strings. Session Switch At session switch, actually it just indicates to_Foreground or to_Background, VDMIMFEP is called by VKBD and just notifies the IM32 of the event happened. This notification is passed by ImSendEvent with the event, IM_CHANGESESSION. Note: Either idFromSession or idToSession of IMCHGSESINFO may be NULL under DOS Fullscreen support. Session Termination VDMIMFEP gets a notification from VKBD when the opened DOS session is about to terminate. With this notification, VDMIMFEP calls DeregisterMoniter function internally. As the result of this call, the VKBD receives the command, VKBDSYSREQ_MONDEREGIS and disables its event notifications, especially keyboard inputs for the session. Once the command is handled, VDMIMFEPcalls XimaClose API. Then, XIMACALL releases all allocated resources for this VDMIMFEP (or DOS session) with XimaClose. It also deregisters the IM32 worker routine by DsmDeregisterFunc with the stored hIMI. (The hIMI can be also retrieved through ImQuerySessionDefInstance.) Then, to notify the IM32 of the session termination, it calls ImSendEvent with the event, IM_CLOSESESSION. After XimaClose API returns, VDMIMFEP calls ImCloseService to release the IMS handle assigned for the session. Keyboard Input VDMIMFEP is just like a Keyboard monitor process. It registers itself into VKBD, reads keyboard packets from the Int16 handler, processes the packets and finally writes them back to the DOS Keyboard buffer. So, applications can get the processed keyboard packets naturally. In the current IM16 model, when VDMIMFEP receives the Keyboard packet, it is passed to XIMACALL through both XimaPreConv and XimaConv APIs. This is same as OS/2 Fullscreen support. Under the new IM32 model, VDMIMFEP works exactly same as IMMON. When VDMIMFEP calls XimaPreConv with the packet got from VKBD, XIMACALLS converts it to the IMCHARINFO (of OS2IM) format and calls ImSendEvent with the event, IM_CHAR. The subsequent requests, e.g. display candidate list, are passed to the IM32 worker routine in XIMACALL registered at session creation, just like OS/2 Fullscreen support. CodePage Change When a codepage (keyboard codepage) is changed, the VKBD sends a specific event, VKBDEVENT_CHG_CP (new event for the IM32 support) out to VDMIMFEP. With this event, VDMIMFEP can know the new codepage and sets it to XIMACALL by XimaSetCp API. XIMACALL then calls ImSendEvent with the event, IM_CHANGECP to notify the IM32 of the new code page. Keyboard Mode Change This is exactly same as OS/2 Fullscreen support. In order to notify the IM32 of the current or updated keyboard modes, VDMIMFEP, actually XIMACALL has to look at each keyboard packet, and once it changes the mode, it calls ImSetIMMode API with the update d mode. This notification has to be made for not only for physical mode change, but also software mode change request. IM16 support The new DOS Fullscreen Input stuffs support both the current IM16 and the new IM32 models. In case of IME16 selected, they just work as the current implementation, that is, they might not call the IM32 for most of their processing. When IME32 is loaded, they cooperate with the IM32 (i.e.OS2IM) as much as they could. Free PS Support (Setting Dialog) This is the same requirement as OS/2 Fullscreen support. please refer OS/2 Fullscreen support. OS2_FS_FEP for IME16 This is the same support as current IME. DOS_FEP for IM VIMM mechanism supports that IAE request of VDM is routed to IME32. DOS_FEP for IME16 Current design is used. Coexistence of the stub for IME16 and new IM will be considered. - VKKC vs VIMM - iaestub vs iae4im User can select DOS FEP by writing DOS Device in DOS Setting. When IAESTUB.SYS is written in DOS Device, 16 bit IME is used. When IAE4IM.SYS is written in DOS Device, 32 bit IME is used. ═══ 9. Comparison of Each Session ═══ Setting Panel The following table shows whether the IME can display the IME Setting panel in each sesion. ┌────────────────────┬────────────────────┐ │Session Type │IME Setting │ ├────────────────────┼────────────────────┤ │PM │Ok │ ├────────────────────┼────────────────────┤ │OS/2 Fullscreen │NG │ ├────────────────────┼────────────────────┤ │DOS(OS2_FS_FEP) │NG │ ├────────────────────┼────────────────────┤ │DOS(DOS_FEP) │NG │ ├────────────────────┼────────────────────┤ │WinOS2 │NG │ └────────────────────┴────────────────────┘ ═══ 10. Performance ═══ At 16 bit version IME, the IME is attached to the Frame window with FCF_DBE_APPSTAT. At the new IM module, all Frame window have the IM instance. All keyboard event will be passed to the IME. ═══ 11. Compatibility ═══ WinDBCSxxx There are two following API s about controlling Input staff and IME in OS/2 Warp 3.0. - WinDBCSIMEControl - WinDBCSModeControl These API have an effect on the new IM module also. The application can control the IME, which conforms the new IM mechanism, by using these APIs. WM_QUERYCONVERTPOS The IM system send the WM_QUERYCONVERTPOS message to the application. The IM system selects the action by the return value as following: 1. usCode ==QCP_NOCONVERT do nothing 2. usCode ==QCP_CONVERT(xleft==-1,ybotton==-1,xright==0,ytop==0) do nothing 3. other case call ImSetConversionPos() Conversion Font PRESPARAMS (PP_FONTNAMESIZE) The IM system queries the presentation parameter of the target window in order to get the information of the conversion font. MLM_QUERYFONT The IM system send the MLM_QUERYFONT message to MLE control in order to get the information of the conversion font. WinPostMsg of WM_CHAR At the legacy IME16 model, the WM_CHAR message posted by WinPostMsg is passed to the IME by PMWIN. At the IM model, the WM_CHAR message posted by WinPostMsg is NEVER passed to the IME. DBCS Status Window Class At OS/2 Warp, there are the following three DBCS window classes in order to support the DBCS input displaying. - WC_DBE_APPSTAT - WC_DBE_KBDSTAT - WC_DBE_PECIC The window instances of these DBCS window classes are created per the frame window even if the queue codepage of the frame window, the frame creation flag of whom does not have FCF_DBE_APPSTAT, is not DBCS codepage. At the IM model, the window instances of the DBCS window classes are created only when an application sets FCF_DBE_APPSTAT in the frame creation flag. The initial window size of these windows is zero. The size of windows are changed to no-zero when an app lication sends WM_DBE_SETAPPLSTAT message with DBE_WPM_APPLSTAT_VISIBILITY (DBE_AS_APPLTOP, DBE_AS_KBDTOP or DBE_AS_PECICTOP). The drawing function of the WC_DBE_KBDSTAT and WC_DBE_PECIC window is disable. The drawing function of the only WC_DBE_APPSTAT window class is enable. The IM system never send the WM_SETWINDOWPARAMS to WC_DBE_KBDSTAT and WC_DBE_PECIC window. ═══ 12. IM Interface ═══ Overview APIs Messages ═══ 12.1. Overview ═══ Overview IME(Input Method Editor) is a special way to input various characters, such as Japanese, Chinese, etc. The IME gets keyboard inputs, usually those are the pronunciation of the target character, and then convert them, show the candidates, and so on. Some applications, like word processor, may want to use the IME functions. IM Interface provides a way to access and control the IME to the applications. The IM Interface is available for only PM applications. ═══ 12.1.1. How to control the IME ═══ IME is associated with IM Instance. To control the IME, application needs a handle of the IM Instance. There is a sample. ULONG ConvertStringSample(HWND hwnd, PSZ pSrcString, PCANDIDATELISTHEADER pBuffer PULONG pulBufLen, ULONG ulFlag) { HIMI himi, *pprehimi; rc = ImCreateInstance(&himi); if(rc == NO_ERROR) { rc = ImAssociateInstance(hwnd, himi,pprehimi); if(rc == NO_ERROR) { rc = ImGetInstance(hwnd, &himi); if(rc == NO_ERROR) { rc = ImConvertString(himi, pSrcString, pBuffer, pulBufLen, ulFlag); ImReleaseInstance(hwnd, himi); } } ImDestroyInstance(himi); } return rc; } ═══ 12.2. APIs ═══ ImAssociateInstance ImCreateInstance ImConvertString ImDeregisterWord ImDestroyInstance ImEnumRegisterWord ImEscape ImGetConversionString ImGetInstance ImGetResultString ImGetStatusString ImIsIMEMessage ImQueryCandidateList ImQueryCandidateWindowPos ImQueryConversionAngle ImQueryConversionFont ImQueryConversionFontSize ImQueryConversionWindowPos ImQueryCurrentIME ImQueryDefaultIME ImQueryDefaultIMWindow ImQueryIMEID ImQueryIMEInfo ImQueryIMEList ImQueryIMEProperty ImQueryIMMode ImQueryInfoMsg ImQueryMsgQueueProperty ImQueryRegisterWordType ImQueryStatusWindowPos ImRegisterWord ImReleaseInstance ImRequestIME ImSetCandidateWindowPos ImSetConversionAngle ImSetConversionFont ImSetConversionFontSize ImSetConversionString ImSetConversionWindowPos ImSetCurrentIME ImSetDefaultIME ImSetIMEListOrder ImSetIMMode ImSetMsgQueueProperty ImSetStatusWindowPos ImShowIMEDlg ImShowStatusWindow ═══ 12.2.1. ImAssociateInstance ═══ ImAssociateInstance This function associates the specified IM Instance with the specified window. When a window is created, the system associates the default IM Instance with that. So applications can change the IM Instance to their own IM Instance which was created by calli ng ImCreateInstance. If hIMI is NULL, this funcion removes the association of the IM instance from the specified window. Format: APIRET APIENTRY ImAssociateInstance(HWND hWnd, HIMI hIMI, PHIMI phIMI) Parameters: hWnd(input) - a window handle to be associated with an IM Instance hIMI(input) - a handle of the IM Instance to be associated phIMI(output) - a pointer to a handle of IM instance which was previously associated with the window Return: Zero is successful. Others are errors. Remarks: This api must be called in the same thread which calls the corresponding ImCreateInstance. ═══ 12.2.2. ImCreateInstance ═══ ImCreateInstance If an application wants to use their own IM Instance, not the default one, the application can create a new IM Instance with this function. The system allocates memory for the instance and initialize it. Format: APIRET APIENTRY ImCreateInstance(PHIMI phIMI) Parameters: phIMI(output) - a pointer to a handle of an IM Instance to be created Return: Zero is successful. Others are errors. ═══ 12.2.3. ImConvertString ═══ ImConvertString Applications can convert any strings by using IME conversion engine. Format: APIRET APIENTRY ImConvertString(HIMI hIMI, PSZ pSrc, PCANDIDATELISTHEADER pDst, PULONG pulBufLen, ULONG ulFlag) Parameters: hIMI(input) - a handle of a IM Instance pSrc(input) - a pointer to a string to be converted pDst(output) - a bufferto be copied CANDIDATELISTHEADER into pulBufLen(input/output) - (input)size, in bytes, of the buffer for the CANDIDATELISTHEADER (output) - actual size of CANDIDATELISTHEADER to be copied into the buffer, or when ulBufLen is 0, this is necessary size of CANDIDATELIST to be copied. ulFlag - type of conversion ┌───────────────┬────────────────────────────────────────┐ │Type │Description │ ├───────────────┼────────────────────────────────────────┤ │CNV_NORMAL │The source string, pSrc, is a reading │ │ │string. And this function copies a │ │ │result string to the destination │ │ │buffer,pDst. │ ├───────────────┼────────────────────────────────────────┤ │CNV_REVERSE │The source string is a result string, │ │ │and the desitination is a reading │ │ │string. │ ├───────────────┼────────────────────────────────────────┤ │CNV_READLEN │The source string is a result string. │ │ │This function returns size of the │ │ │reading string into pulSize. │ └───────────────┴────────────────────────────────────────┘ Return: Zero is successful. Others are errors. Remarks: See CANDIDATELISTHEADER ═══ 12.2.4. ImDeregisterWord ═══ ImDeregisterWord Applications can remove words from a dictionary of IME. Format: APIRET APIENTRY ImDeregisterWord(HIMI hIMI, PSZ pszReading, ULONG ulType, PSZ pszDeregister) Parameters: hIMI(input) - a handle of a IM Instance to be associated with the IME pszReading(input) - a pointer to a reading string of the word to deregister ulType(input) - type of the register string pszDeregister(input) - a pointer to the register string to remove Return: Zero is successful. Others are errors. ═══ 12.2.5. ImDestroyInstance ═══ ImDestroyInstance If an application created their own IM Instance by calling ImCreateInstance, the application must release the instance with this function before the application ends. Format: APIRET APIENTRY ImDestroyInstance(HIMI hIMI) Parameters: hIMI(input) - a handle of IM Instance to be destroyed Return: Zero is successful. Others are errors. Remarks: Before calling this function, an application must remove the association with any windows by using ImAssociateInstance. ═══ 12.2.6. ImEnumRegisterWord ═══ ImEnumRegisterWord Applications can enumerate register words by its reading, style and register string. Format: APIRET APIENTRY ImEnumRegisterWord(HIMI hIMI, REGISTERWORDENUMPROC pfnEnumProc, PSZ pszReading, ULONG ulType, PSZ pszRegister, PVOID pData) Parameters: hIMI(input) - a handle of IM Instance pfnEnumProc(input) - pointer to EnumRegisterWord, the application-defined function. This function will be called back and used to enumerate. pszReading(inputt) - pointer to the reading string to be enumerated. When this is NULL, all reading strings matching with ulStyle and pszRegister are enumerated. ulType(input) - type of the register word. When this is 0, all types matching with pszReading and pszRegister are enumerated. pszRegister(input) - pointer to the register string to be enumerated. When this is NULL, all register strings matching with pszReading and ulStyle are enumerated. pData(input) - Application uses this data. This is passed to the function specified by pfnEnumProc. Return: Remarks: EnumRegisterWord - Application-defined function. Format: ULONG EXPENTRY EnumRegisterWord(PSZ pszReading, ULONG ulType, PSZ pszRegister, ═══ 12.2.7. ImEscape ═══ ImEscape Applications can run IME-specific functions directly. When calling this function, the application should know the IME-specific functions to specify in ulEscape. Format: APIRET APIENTRY ImEscape(HIMI hIMI, ULONG ulEscape, PVOID pData) Parameters: hIMI(input) - a handle of an IM Instance ulEscape(input) - index of subfunction The system reserves from IME_ESC_RESERVED_FIRST to IME_ESC_RESERVED_LAST, and IME can use the values defined from IME_ESC_PRIVATE_FIRST to IME_ESC_PRIVATE_LAST. pData - subfunctions' specific data (input/output) Return: Zero is successful. Others are errors. ═══ 12.2.8. ImGetConversionString ═══ ImGetConversionString Applications can get some information about conversion string. Format: APIRET APIENTRY ImGetConversionString(HIMI hIMI, ULONG ulIndex, PVOID pBuf, PULONG pulBufLen) Parameters: hIMI(input) - a handle of a IM Instance associated with a conversion string ulIndex(input) - index of information to query ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_CONV_CONVERSIONATTR │Gets an attribute of the coversion string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_CONV_CONVERSIONCLAUSE │Gets clause informaiton of the conversion string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_CONV_READINGATTR │Gets an attribute of a reading string of the │ │ │conversion string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_CONV_READINGCLAUSE │Gets clause information of a reading string of the│ │ │conversion string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_CONV_READINGSTRING │Gets a reading string of the conversion string. │ │ │Output is a 0-terminated string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_CONV_CONVERSIONSTRING │Gets the conversion string. Output is a │ │ │0-terminated string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_CONV_CURSORPOS │Gets a cursor position in the conversion string. │ │ │Output is ULONG value. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_CONV_CURSORATTR │Gets a cursor attribute in the conversion string. │ │ │Output is ULONG value. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_CONV_CHANGESTART │Gets a starting position of any changes in the │ │ │conversion string. Output is ULONG value. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ The attribute of the string ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Attribute │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CP_ATTR_INPUT │The characters are now on input, not yet │ │ │converted. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CP_ATTR_TARGET_CONVERTED │The characters have been converted and are │ │ │selected now. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CP_ATTR_CONVERTED │The characters have been converted. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CP_ATTR_TARGET_NOTCONVERTED │The characters are selected and not yet converted.│ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CP_ATTR_INPUT_ERROR │The characters are invalid. IME can't convert │ │ │them. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ Cursor attributes are, ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Attribute │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CP_CURSORATTR_INSERT │The double-sized cursor │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CP_CURSORATTR_INVISIBLE │Cursor is invisible. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ The clause information is an array of ULONG values. The value means offset from the top of the conversion string (in bytes) for the each clause. And the last value contains length of the conversion string. The first clause always starts from off set 0, so the first value of the clause information must be 0. pBuf(output) - a buffer to be copied the information into pulBufLen(input/output) - (input)size, in bytes, of the buffer (output) - actual size of data copied to the buffer. If 0 is input in ulBufLen, this gets size of buffer to get full information. Return: Zero is successful. Others are errors. ═══ 12.2.9. ImGetInstance ═══ ImGetInstance When an application access to information in IM Instance, it must call this function before the access, and get the proper handle of the IM Instance. Format: APIRET APIENTRY ImGetInstance(HWND hWnd, PHIMI phIMI) Parameters: hWnd(input) - a window handle phIMI(output) - a handle of an IM Instance Return: Zero is successful. Others are errors. ═══ 12.2.10. ImGetResultString ═══ ImGetResultString Applications can get information about result string. Format: APIRET APIENTRY ImGetResultString(HIMI hIMI, ULONG ulIndex, PVOID pBuf, PULONG pulBufLen) Parameters: hIMI(input) - a handle of a IM Instance associated with a conversion string ulIndex(input) - index of information to query ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_RESULT_RESULTSTRING │Gets a result string. Output is a 0-terminated │ │ │string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_RESULT_RESULTATTR │Gets an attribute of the result string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_RESULT_RESULTCLAUSE │Gets clause information of the result string │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_RESULT_READINGSTRING │Gets a reading string of the result string. Output│ │ │is a 0-terminated string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_RESULT_READINGATTR │Gets an attribute of the reading string. The │ │ │attribute will be RP_ATTR_INTERIM which means it's│ │ │an interim string, or RP_ATTR_RESULT which means │ │ │it's a result string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_RESULT_READINGCLAUSE │Gets clause information of the reading string │ └──────────────────────────────┴──────────────────────────────────────────────────┘ Please refer to ImGetConversionString about the clause information. pBuf(output) - a buffer to be copied the information into pulBufLen(input/output) - (input)size, in bytes, of the buffer (output) actual size of data copied to the buffer. If 0 is input in ulBufLen, this gets size of buffer to get full information. Return: Zero is successful. Others are errors. Remarks: This API causes no change of information in the IM Instance. When level-3 application call this function, it must not send the corresponding WM_IMEREQUEST message to the default IM window. ═══ 12.2.11. ImGetStatusString ═══ ImGetStatusString Applications can get a status string. Format: APIRET APIENTRY ImGetStatusString(HIMI hIMI, ULONG ulIndex, PVOID pBuf, PULONG pulBufLen) Parameters: hIMI(input) - a handle of a IMInstance ulIndex(input) - index of information to query ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_STATUS_STRING │Status string. Output is a 0-terminated string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_STATUS_STRINGATTR │Attribute of the status string │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_STATUS_CURSORPOS │Cursor position. Output is ULONG value. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_STATUS_CURSORATTR │Cursor attribute. Output is ULONG value. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ Status string attributes are, ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SP_STRING_REVERSED │The text will be drawn in reversed color. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SP_STRING_UNDERSCORE │The text will be drawn with underscore. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SP_STRING_BACKCOLOR │The text background color will be cyan. (Normally │ │ │it is white.) │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SP_STRING_FORECOLOR │The text foreground color will be red. (Normally │ │ │it is black.) │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SP_STRING_SEPARATOR │The text will have a separator on right side edge.│ └──────────────────────────────┴──────────────────────────────────────────────────┘ Cursor attributes are, ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SP_CSR_INSERT │The double-sized cursor appears as normal. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SP_CSR_INVISIBLE │Cursor is invisible. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ pBuf(output) - a buffer to be copied the information into pulBufLen(input/output) - (input)size, in bytes, of the buffer (output)actual size of data copied to the buffer. If 0 is input in ulBufLen, this gets size of buffer to get full information. Return: Zero is successful. Others are errors. ═══ 12.2.12. ImIsIMEMessage ═══ ImIsIMEMessage This function checks whether the specified message is for IM winodw and send the message to the specified IM window. Format: APIRET APIENTRY ImIsIMEMessage(HWND hwndIm, ULONG ulMsgid, MPARAM mpParam1, MPARAM mpParam2, pBOOL pfResult) Parameters: hwndIm(input) - a window handle of a IM window ulMsgid(input) - message ID mpParam1(input) - parameter 1 mpParam2(input) - parameter 2 pfResult(output) - If this pointer gets TRUE, this messages is processed by the IM window, and if FALSE, the message is not processed by the IM window. Return: Zero is successful. Others are errors. ═══ 12.2.13. ImQueryCandidateList ═══ ImQueryCandidateList Applications can get a candidate list and the count of all of the candidate lists. Sometimes there are several candidate lists, so specify the ulIndex. If the application doesn't know the count of the lists, the application gets it by calling this with 0x ffffffff of ulIndex. Format: APIRET APIENTRY ImQueryCandidateList(HIMI hIMI, ULONG ulIndex, PCANDIDATELISTHEADER pCandidateList, PULONG pulBufLen) Parameters: hIMI(input) - a handle of an IM Instance ulIndex(input) - 0-based index of a candidate list pCandidateList(output) - a buffer to receive CANDIDATELISTHEADER structure pulBufLen(input/output) - (input)size, in bytes, of a buffer for the CANDIDATELISTHEADER (output) - actual size, in bytes, of CANDIDATELISTHEADER copied to the buffer. Or if the ulIndex is 0xffffffff, this pointer gets the count of all of candidate lists. If 0 is input in ulBufLen, this gets size of the candidate list specified by u Index. Return: Zero is successful. Others are errors. Remarks: See CANDIDATELISTHEADER. ═══ 12.2.14. ImQueryCandidateWindowPos ═══ ImQueryCandidateWindowPos Applications can get information about a candidate window. Format: APIRET APIENTRY ImQueryCandidateWindowPos(HIMI hIMI, PCANDIDATEPOS pCandidatePos) Parameters: hIMI(input) - a handle of an IM Instance pCandidatePos(output) - a buffer to be copied CANDIDATEPOS into Return: Zero is successful. Others are errors. Remarks: See CANDIDATEPOS ═══ 12.2.15. ImQueryConversionAngle ═══ ImQueryConversionAngle Application can get the information about the writing angle of the conversion window. Format: APIRET APIENTRY ImQueryConversionAngle(HIMI hIMI, PGRADIENTL pgradlAngle) Parameters: hIMI(input) - a handle of a IM Instance pgradAngle(output) - a pointer to a buffer to receive GRADIENT structure Return: Zero is successful. Others are errors. ═══ 12.2.16. ImQueryConversionFont ═══ ImQueryConversionFont Applications can get font information in a conversion window. Format: APIRET ImQueryConversionFont(HIMI hIMI, PFATTRS pFontAttrs) Parameters: hIMI(input) - a handle of a IM Instance pFontAttrs(output) - a buffer to be copied the font information, FATTRS into Return: Zero is successful. Others are errors. ═══ 12.2.17. ImQueryConversionFontSize ═══ ImQueryConversionFontSize Application can get font cell size information of the conversion window. Format: APIRET APIENTRY ImQueryConversionFontSize(HIMI hIMI, PSIZEF psizfxBox) Parameters: hIMI(input) - a handle of a IM Instance psizfxBox(output) - a pointer to a buffer to receive SIZEF structure ═══ 12.2.18. ImQueryConversionWindowPos ═══ ImQueryConversionWindowPos Applications can get information about a conversion window. Format: APIRET APIENTRY ImQueryConversionWindowPos(HIMI hIMI, PCONVERSIONPOS pConvPos) Parameters: hIMI(input) - a handle of a IM Instance pConvPos(output) - a buffer to be copied CONVERSIONPOS into Return: Zero is successful. Others are errors. Remarks: See CONVERSIONPOS. ═══ 12.2.19. ImQueryCurrentIME ═══ ImQueryCurrentIME Applications can get an IME ID of the current active IME. The IME ID is a specific value of IME, and this is assigned by ImRegisterIME. Format: APIRET APIENTRY ImQueryCurrentIME(HIMI hIMI, PULONG pImeId) Parameters: hIMI(input) - a handle of a IM Instance of the current IME pImeId(output) - a pointer to receive an IME ID. The specific ID is given to each IME when it's registerd to the system. Return: Zero is successful. Others are errors. ═══ 12.2.20. ImQueryDefaultIME ═══ ImQueryDefaultIME Application can get the IME ID of the default IME for the specified codepage. Format: APIRET APIENTRY ImQueryDefaultIME(ULONG ulCodepage, PULONG pImeId) Parameters: ulCodepage(input) - codepage to query the default IME pImeId(output) - IME ID Return: Zero is successful. Others are errors. ═══ 12.2.21. ImQueryDefaultIMWindow ═══ ImQueryDefaultIMWindow Applications can get the default IM window handle. Format: APIRET APIENTRY ImQueryDefaultIMWindow(HWND hWnd, PHWND phWnd) Parameters: hWnd(input) - a window handle of an application phWnd(output) - a window handle of a default IM Window Return: Zero is successful. Others are errors. ═══ 12.2.22. ImQueryIMEID ═══ ImQueryIMEID Applications can get IME ID of specified IME. Format: APIRET APIENTRY ImQueryIMEID(PSZ pszIMEName, PULONG pImeId) Parameters: pszIMEName(input) - IMEName. This is a DLL file name of the IME without extension, and this is registerd to the system by IME Installer. An application which uses this function has t know the IMEName. Otherwise, applications can get all of IME ID by calling ImQueryIMEList. pImeId(output) - a pointer to receive IME ID. Return: Zero is successful. Others are errors. ═══ 12.2.23. ImQueryIMEInfo ═══ ImQueryIMEInfo Applications can get information about a IME. Format: APIRET APIENTRY ImQueryIMEInfo(ULONG ImeId, PIMEINFOHEADER pImeInfoHeader, PULONG pulBufLen) Parameters: ImeId(input) - IME ID pImeInfoHeader(output) - a buffer to be copied IME information into pulBufLen(input/output) - (input)size, in bytes, of the buffer for the IME information (output) actual size of data copied to the buffer. Or when 0 is input in ulBufLen, this receive size of the full information. Return: Zero is successful. Others are errors. Remarks: See IMEINFOHEADER. ═══ 12.2.24. ImQueryIMEList ═══ ImQueryIMEList Applications can get a list of IME with this function. The list is an array of ULONG value of IME ID. ImQueryIMEList copy the IME List into a buffer which the applications prepared. If applications would like to know the number of IME, call this function with 0 of pulCount. Format: APIRET APIENTRY ImQueryIMEList(ULONG ulCodepage, PULONG aImeId, PULONG pulCount) Parameters: ulCodepage(input) - the code page to get IME list from. When this is 0, all of IME on the system will be returned. aImeId(output) - a pointer to a buffer to retrieve an array of IME ID. When pulCount is 0, this is ignored. pulCount(input/output) - number of IMEs. When 0 is input here, the number of all IME suppoting the codepage in ulCodepage will be returned here. Return: Zero is successful. Others are errors. ═══ 12.2.25. ImQueryIMEProperty ═══ ImQueryIMEProperty Applications can get a property and capabilities of IME. Format: APIRET APIENTRY ImQueryIMEProperty(HIMI HIMI, ULONG ulIndex, PULONG pulProp) Parameters: hIMI(input) - a handle of a IM Instance ulIndex(input) - type of property information to query ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │QIP_PROPERTY │Property information │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │QIP_INPUTMODE │Input mode capabilities │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │QIP_CONVERSIONMODE │Conversion mode capabilities │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │QIP_UI │User interface capabilities │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │QIP_SETCONVSTR │Conversion string capabilities │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │QIP_SELECT │Selection inheritance capabilities │ └──────────────────────────────┴──────────────────────────────────────────────────┘ pulProp(output) - property informationwhich depends on the above types. When ulIndex is QIP_PROPERTY, ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │PRP_SPECIALUI │If it's set, IME has a special user interface, so │ │ │application should not draw in IME window. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │PRP_UNICODE │If it's set, strings for the IM Instance have │ │ │UNICODE characters. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │PRP_FORCEPOSITION │If it's set, IME has capability to set a │ │ │conversion window position by │ │ │ImSetConversionWindowPos with CPS_FORCE style. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ When ulindex is QIP_INPUTMODE or QIP_CONVERSIONMODE, this output means supported input mode or conversion mode, which is defined in ImQueryIMMode section. When ulIndex is QIP_UI, ┌──────────────────────────────┬────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼────────────────────────────────────────┤ │UIC_270 │Supports text escapement values of 0 and│ │ │270 │ ├──────────────────────────────┼────────────────────────────────────────┤ │UIC_ANGLE90 │Supports text escapement values of 0, │ │ │90, 180, and 270 │ ├──────────────────────────────┼────────────────────────────────────────┤ │UIC_ANGLEANY │Supports any text escapement value │ └──────────────────────────────┴────────────────────────────────────────┘ When ulIndex is QIP_SETCONVSTR, ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SCSC_CONVSTR │Can create a conversion string, when using │ │ │ImSetConversionString with SCS_STRING. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SCSC_MAKEREAD │Can create a reading string from a conversion │ │ │string, when using ImSetConversionString with │ │ │SCS_STRING │ └──────────────────────────────┴──────────────────────────────────────────────────┘ When ulIndex is QIP_SELECT, ┌──────────────────────────────┬────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼────────────────────────────────────────┤ │SLC_INPUTMODE │Inherits input mode when a new IME is │ │ │selected. │ ├──────────────────────────────┼────────────────────────────────────────┤ │SLC_CONVERSIONMODE │Inherits conversion mode when a new IME │ │ │is selected. │ └──────────────────────────────┴────────────────────────────────────────┘ Return: Zero is successful. Others are errors. ═══ 12.2.26. ImQueryIMMode ═══ ImQueryIMMode Applications can query the current input mode, conversion mode, and open status. Format: APIRET APIENTRY ImQueryIMMode(HIMI hIMI, PULONG pulInputMode, PULONG pulConversionMode) Parameters: hIMI(input) - a handle of a IM Instance pulInputMode(output) - IME input mode or IME's on/off ┌──────────────────────────────┬────────────────────────────────────────┐ │Conversion_Mode │Description │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_NLS_ALPHANUMERIC │Alphanumeric mode │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_NLS_HIRAGANA │HIRAGANA mode │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_NLS_KATAKANA │KATAKANA mode │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_WIDTH_HALF │HANKAKU mode │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_WIDTH_FULL │ZENKAKU mode │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_ROMAJI_OFF │Not in ROMAJI mode │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_ROMAJI_ON │ROMAJI mode │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_SYSTEMROMAJI_ENABLE │System ROMAJI translation is enabled. │ │ │IME doesn't support ROMAJI translation. │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_SYSTEMROMAJI_DISABLE │System ROMAJI translation is disabled. │ │ │IME supports ROMAJI translation by │ │ │itself │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_IME_OFF │IME is turned off. │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_IME_ON │IME is turned on and active. │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_IME_ENABLE │IME is enabled. │ ├──────────────────────────────┼────────────────────────────────────────┤ │IMI_IM_IME_DISABLE │IME is disabled. Any input are not │ │ │passed to IME. │ └──────────────────────────────┴────────────────────────────────────────┘ pulConversionMode(output) - a conversion mode ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Conversion_Mode │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMI_CM_AUTOMATIC │IME converts strings automatically. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMI_CM_PREDICT │IME uses phrase information to predict the next │ │ │character. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMI_CM_PLURALCLAUSE │IME uses plural clause information to convert │ │ │strings. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMI_CM_SINGLE │IME converts strings in single character mode │ └──────────────────────────────┴──────────────────────────────────────────────────┘ Return: Zero is successful. Others are errors. ═══ 12.2.27. ImQueryInfoMsg ═══ ImQueryInfoMsg Applications can get error messages from IME. Format: APIRET APIENTRY ImQueryInfoMsg(HIMI hIMI, ULONG ulIndex, PSZ pBuf, PULONG pulBufLen) Parameters: hIMI(input) - a handle of a IM Instance ulIndex(input) - type of message to get ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_INFOMSG_ERRLEVEL │Error Level │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_INFOMSG_ERRINDEX │Error index │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_INFOMSG_ERRTITLE │Error Title │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_INFOMSG_ERRSTR │Error message string │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IMR_INFOMSG_PRIVATE │IME private message │ └──────────────────────────────┴──────────────────────────────────────────────────┘ pBuf(output) - a pointer to a message string when ulIndex is IMR_INFOMSG_ERRTITLE, IMR_INFOMSG_ERRSTR or IMR_INFOMSG_PRIVATE. When ulIndex is IMR_INFOMSG_ERRLEVEL or IMR_INFOMSG_ERRINDEX, this is reserved 0. pulBufLen(input/output) - (input)size, in bytes, of the string buffer when ulIndex is IMR_INFOMSG_ERRTITLE, IMR_INFOMSG_ERRSTR or IMR_INFOMSG_PRIVATE. (output) actual size of the string. When 0 is input in ulBufLen, this receives size of the needed message string buffer. When ulIndex is IMR_INFOMSG_ERRLEVEL or IMR_INFOMSG_ERRINDEX, this will be one of the following values. When ulIndex is IMR_INFOMSG_ERRLEVEL, ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_ERRLEVEL_ERROR │Error. IME may not be able to continue. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_ERRLEVEL_FATAL │Fatal error. IME cannot continue. Data may be │ │ │lost. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_ERRLEVEL_INFORMATION │No error, but some information for users. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_ERRLEVEL_NONE │No error. Clear the previous message, if it's │ │ │still on the screen. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_ERRLEVEL_WARNING │Warning for an unexpected input or other result. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_ERRLEVEL_HELP │Show help message. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ When ulIndex is IMR_INFOMSG_ERRINDEX, ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_UNSAVABLE │The dictionary or some data cannot be saved. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_NOCONVERT │IME cannot convert. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_NODICTIONARY │IME cannot find the dictionary or the dictionary │ │ │is invalid format. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_NOMODULE │IME cannot find modules needed. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_INVALIDREADING │Reading confliction │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_TOOMANYSTROKES │Too many strokes for a character or a clause │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_TYPINGERROR │Typing error. IME cannot handle. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_UNDEFINED │Unknown error. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_INPUTREADING │IME accepts reading character input. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_INPUTRADICAL │IME accepts radical character input. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_INPUTCODE │IME accepts character code input │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_SELECTCANDIDATE │IME accepts candidate string selection │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IM_INFOID_REVERSECONVERSION │Information about reverse conversion is available.│ └──────────────────────────────┴──────────────────────────────────────────────────┘ Return: Zero is successful. Others are errors. ERROR_BUFFER_OVERFLOW ═══ 12.2.28. ImQueryMsgQueueProperty ═══ ImQueryMsgQueueProperty An application can get the default way of instance association, whether IME-per-frame wayor IME-per-msgq way. Format: APIRET APIENTRY ImQueryMsgQueueProperty(HMQ hmq, PULONG pulFlag) Parameters: hmq(input) - message queue handle pulFlag(output) - message queue property information. ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │value │description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │MQP_INSTANCE_PERMQ │The default IM Instance is created per Message │ │ │Queue │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │MQP_INSTANCE_PERFRAME │The default IM Instance is created per frame │ │ │window │ └──────────────────────────────┴──────────────────────────────────────────────────┘ Return: ═══ 12.2.29. ImQueryRegisterWordType ═══ ImQueryRegisterWordType Applications can get a type of a register word supported by IME. Format: APIRET APIENTRY ImQueryRegisterWordType(HIMI hIMI, PULONG pulCount, PWORDTYPE pWordType) Parameters: hIMI(input) - a handle of a IM Instance pulCount(input/output) - (input)max number of WORDTYPE to receive (output) actual number of WORDTYPE copied to the buffer. Or when 0 is input in pulCount, this receives number of all available WORDTYPEs. pWordType(output) - a buffer to retrieve the WORDTYPEs Return: Zero is successful. Others are errors. Remarks: See WORDTYPE ═══ 12.2.30. ImQueryStatusWindowPos ═══ ImQueryStatusWindowPos Applications can get position of a status window. Format: APIRET APIENTRY ImQueryStatusWindowPos(HIMI hIMI, PPOINTL pptPos, PSIZEL pszlSize) Parameters: hIMI(input) - a handle of a IM Instance pptPos(output) - a pointer to window position in World coordinate pszlSize(output) - a pointer to the window size Return: Zero is successful. Others are errors. ═══ 12.2.31. ImRegisterWord ═══ ImRegisterWord Applications can register a word to a dictionary of IME. Format: APIRET APIENTRY ImRegisterWord(HIMI hIMI, PSZ pszReading, ULONG ulType, PSZ pszRegister) Parameters: hIMI(input) - a handle of a IM Instance pszReading(input) - a pointer to a reading string ulType(input) - type of a register string pszRegister(input) - a pointer to the string to register Return: Zero is successful. Others are errors. ═══ 12.2.32. ImReleaseInstance ═══ ImReleaseInstance This function releases IM Instance. An application must call this function for each call of ImGetInstance. Format: APIRET APIENTRY ImReleaseInstance(HWND hWnd, HIMI hIMI) Parameters: hWnd(input) - a window handle hIMI(input) - a handle of a IM Instance Return: Zero is successful. Others are errors. ═══ 12.2.33. ImRequestIME ═══ ImRequestIME Applications can make some requests to IME . Format: APIRET APIENTRY ImRequestIME(HIMI hIMI, ULONG ulAction, ULONG ulIndex, ULONG ulValue) Parameters: hIMI(input) - a handle of a IM Instance ulAction(input) - type of request to IME ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │REQ_CHANGECANDIDATELIST │Changes the current selected candidate. ulIndex is│ │ │an index of the current candidate list. ulValue is│ │ │not used. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │REQ_CLOSECANDIDATE │Closes a candidate list. ulIndex is an index of │ │ │the candidate list. ulValue is not used. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │REQ_CONVERSIONSTRING │ulIndex is one of the following. CNV_CANCEL, │ │ │CNV_COMPLETE, CNV_CONVERT, CNV_REVERT ulValue is │ │ │not used. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │REQ_OPENCANDIDATE │Opens a candidate list. ulIndex is an index of the│ │ │candidate list. ulValue is not used. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │REQ_SELECTCANDIDATE │Selects one of candidates. ulIndex is an index of │ │ │a candidate list to be selected. ulValue is an │ │ │index of the candidate string in the list. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │REQ_SETCANDIDATEPAGESIZE │Sets page size of a candidate list. ulIndex is an │ │ │index of the candidate list. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │REQ_SETCANDIDATEPAGESTART │ulIndex is an index of the candidate list. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ ulIndex(input) - index of a candidate list. Or when ulAction is REQ_CONVERSIONSTRING, this is one of the following. ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CNV_CANCEL │Clears the conversion string │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CNV_COMPLETE │Completes the conversion, sets the conversion │ │ │string as the result string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CNV_CONVERT │Converts the conversion string. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CNV_REVERT │Cancels the current conversion string and revert │ │ │to the unconverted string. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ ulValue(input) - When ulAction is REQ_SELECTCANDIDATE, this is index of a candidate string. Return: Zero is successful. Others are errors. ═══ 12.2.34. ImSetCandidateWindowPos ═══ ImSetCandidateWindowPos Applications can set information about a candidate window. Format: APIRET APIENTRY ImSetCandidateWindowPos(HIMI hIMI, PCANDIDATEPOS pCandidatePos) Parameters: hIMI(input) - a handle of a IM Instance pCandidatePos(input) - a pointer to CANDIDATEPOS Return: Zero is successful. Others are errors. Remarks: See CANDIDATEPOS. ═══ 12.2.35. ImSetConversionAngle ═══ ImSetConversionAngle An application can set the information about the writing angle of the conversion window. Format: APIRET APIENTRY ImSetConversionAngle(HIMI hIMI, PGRADIENTL pgradlAngle) Parameters: hIMI(input) - a handle of a IM Instance pradlAngle(input) - a pointer to a GRADIENTL structure Remarks: ImSetConversionAngle, ImSetConversionFont and ImSetConversionFontSize cause the same message, ═══ 12.2.36. ImSetConversionFont ═══ ImSetConversionFont Applications can set font attribute information in a conversion window. Format: APIRET APIENTRY ImSetConversionFont(HIMI hIMI, PFATTRS pFontAttr) Parameters: hIMI(input) - a handle of a IM Instance pFontAttr(input) - a pointer to font information, FATTRS Return: Zero is successful. Others are errors. ═══ 12.2.37. ImSetConversionFontSize ═══ ImSetConversionFontSize An application can set the information about the font cell size of the conversion window. Format: APIRET APIENTRY ImSetConversionFontSize(HIMI hIMI, PSIZEF psizfxBox) Parameters: hIMI(input) - a handle of a IM Instance psizfxBox(input) - a pointer to SIZEF structure Return: Zero is successful. Others are errors. ═══ 12.2.38. ImSetConversionString ═══ ImSetConversionString Applications can set a information about a conversion string and a reading string of the conversion string. Format: APIRET APIENTRY ImSetConversionString(HIMI hIMI, ULONG ulIndex, PVOID pConv, ULONG ulConvLen, PVOID pReading, ULONG ulReadingLen) Parameters: hIMI(input) - a handle of a IM Instance ulIndex(input) - type of information to set ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IME_SCS_STRING │Sets a conversion string, reading string, or both.│ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IME_SCS_ATTRIBUTE │Sets attributes for a conversion string, reading │ │ │string, or both. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IME_SCS_CLAUSEINFO │Sets clause information for a conversion string, │ │ │reading string, or both. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ pConv(input) - a pointer to the conversion string. If there are no conversion strings to set, this must be NULL. ulConvLen(input) - size of the conversion string pReading(input) - a pointer to the reading string. If there are no reading string to set, this must be NULL. ulReadingLen(input) - size of the reading string Return: Zero is successful. Others are errors. ═══ 12.2.39. ImSetConversionWindowPos ═══ ImSetConversionWindowPos Applications can set position of a conversion window. Format: APIRET APIENTRY ImSetConversionWindowPos(HIMI hIMI, PCONVERSIONPOS pConvPos) Parameters: hIMI(input) - a handle of a IM Instance associated with the conversion window. pConvPos(input) - a pointer to position of conversion window, CONVERSIONPOS. Return: Zero is successful. Others are errors. Remarks: See CONVERSIONPOS ═══ 12.2.40. ImSetCurrentIME ═══ ImSetCurrentIME Applications can change an IME directly by setting a IME ID with this function. And also applications can change the IME one by one according to the order of IME List. Format: APIRET APIENTRY ImSetCurrentIME(HIMI hIMI, ULONG ulAction, ULONG ImeId) Parameters: hIMI - a handle of a IM Instance ulAction(input) - This can be one of the following values. ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Value │Action │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SCI_NOIME │Removes IME │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SCI_NEXT │Changes IME to the next one in the IME List. If │ │ │it's the last of the list, go back to the first │ │ │one. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SCI_PREVIOUS │Changes IME to the previous one in the IME List. │ │ │If it's the first of the list, go forward to the │ │ │last one. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SCI_SETBYID │Sets IME by specifying its IME ID. The ID is set │ │ │in ImeId. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ ImeId(input) - an IME ID. This is valid only when ulAction is SCI_SETBYID. Return: Zero is successful. Others are errors. ═══ 12.2.41. ImSetDefaultIME ═══ ImSetDefaultIME Applications can set the default IME of the specified codepage. Format: APIRET APIENTRY ImSetDefaultIME(ULONG ulCodepage, ULONG ImeId) Parameters: ulCodepage(input) - codepage to set the default IME ImeId(input) - IME ID of the IME to be the default Return: Zero is successful. Others are errors. ═══ 12.2.42. ImSetIMEListOrder ═══ ImSetIMEListOrder This function changes the order of IME in the IME list. Format: APIRET APIENTRY ImSetIMEListOrder(ULONG ulCodepage, ULONG ulAction, ULONG ImeIdTarget, ULONG ImeIdIndex) Parameters: ulCodepage(input) - the codepage to set IME List order ulAction(input) - This can be one of the following. ┌──────────────────────────────┬────────────────────────────────────────┐ │Action │Description │ ├──────────────────────────────┼────────────────────────────────────────┤ │SLO_TOP │Sets the specified IME in ImeIdTarget to│ │ │the top of the IME List │ ├──────────────────────────────┼────────────────────────────────────────┤ │SLO_BOTTOM │Sets the specified IME in ImeIdTarget to│ │ │the bottom of the IME List │ ├──────────────────────────────┼────────────────────────────────────────┤ │SLO_SETAFTER │Sets the specified IME of ImeIdTarget │ │ │after the specified IME of ImeIdIndex │ ├──────────────────────────────┼────────────────────────────────────────┤ │SLO_SETBEFORE │Sets the specified IME of ImeIdTarget │ │ │before the specified IME of ImeIdIndex │ ├──────────────────────────────┼────────────────────────────────────────┤ │SLO_ROTATE │Sets the specified IME in ImeIdTarget to│ │ │the top of the IME List by rotation of │ │ │the list. No other order change occurs. │ └──────────────────────────────┴────────────────────────────────────────┘ ImeIdTarget(input) - the ID of IME to be changed order. ImeIdIndex(input) - When ulAction is SLO_SETAFTER or SLO_SETBEFORE, it's valid. Return: Zero is successful. Others are errors. ═══ 12.2.43. ImSetIMMode ═══ ImSetIMMode Applications can set the current input mode, conversion mode, and open status. Format: APIRET APIENTRY ImSetIMMode(HIMI hIMI, ULONG ulInputMode, ULONG ulConversionMode) Parameters: hIMI(input) - a handle of a IM Instance ulInputMode(input) - a input mode or IME's on/off ulConversionMode(input) - a conversion mode Please refer to ImQueryIMMode for the definition of the input mode and conversion mode. Return: Zero is successful. Others are errors. ═══ 12.2.44. ImSetMsgQueueProperty ═══ ImSetMsgQueueProperty An application can set the default IM Instance association way. Format: APIRET APIENTRY ImSetMsgQueueProperty( HMQ hmq, ULONG ulFlag ) Parameters: hmq(input) - message queue handle ulFlag(input) - message queue property information to set. Please refer to ImQueryMsgQueueProperty Return: Zero is successful. Others are errors. ═══ 12.2.45. ImSetStatusWindowPos ═══ ImSetStatusWindowPos Applications can set position of a status window. Format: APIRET APIENTRY ImSetStatusWindowPos(HIMI hIMI, PPOINTL pptPos) Parameters: hIMI(input) - a handle of a IM Instance associated with the status window. pptPos(input) - a pointer to a window position in World coordinate Return: Zero is successful. Others are errors. ═══ 12.2.46. ImShowIMEDlg ═══ ImShowIMEDlg This function make the IME display setting dialog boxes, which are the configuration dialog, the word register dialog, and the dictionary selection dialog. Format: APIRET APIENTRY ImShowIMEDlg(HIMI hIMI, ULONG ulDlgType, PREGISTERWORDHEADER pRegWord) Parameters: hIMI(input) - a handle of an IM Instance ulDlgType(input) - Dialog box type ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Type │Meaning │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IME_DLG_CONFIG │IME Configuration Dialog │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IME_DLG_REGWORD │Word Register Dialog │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │IME_DLG_DICTIONARY │Dictionary Selection Dialog │ └──────────────────────────────┴──────────────────────────────────────────────────┘ pRegWord(input) - a pointer to a REGISTERWORDHEADER structure. This parameter is valid only when the ulDlgType is IME_DLG_REGWORD. Return: Zero is successful. Others are errors Remarks: See REGISTERWORDHEADER structure. ═══ 12.2.47. ImShowStatusWindow ═══ ImShowStatusWindow This function show or hide a status window. Format: APIRET APIENTRY ImShowStatusWindow(HIMI hImi, ULONG ulFlag) Parameters: hImi(input) - a handle of IM Instance ulFlag(input) - flag ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Value │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SSW_SHOW │Show the status window │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │SSW_HIDE │Hide the status window │ └──────────────────────────────┴──────────────────────────────────────────────────┘ Return: Zero is successful. Others are errors. ═══ 12.3. Messages ═══ WM_IMECONTROL WM_IMEREQUEST WM_IMENOTIFY ═══ 12.3.1. WM_IMECONTROL ═══ IMECONTROL This message is sent to the IM window when an application want to control the IME. Parameters: mparam1 : ulControl(ULONG) - Control value. This can be one of the following. IMC_HIDESTATUSWINDOW : An application sends this message to IM window to hide the status window. param2 are reserved 0. IMC_QUERYCANDIDATEPOS : An application send this message to IM window to query position of the candidate window. param2 contains the pointer to CANDIDATEPOS. This pointer receives a CANDIDATEPOS structure for the position of the candidate window. IMC_QUERYCONVERSIONANGLE : An application sends this message to IM window to query writing angle in the conversion window. param2 contains the pointer to GRADIENTL. This pointer receives GRADIENTL structure for the font of the conversion window. IMC_QUERYCONVERSIONFONT : An application sends this message to IM window to query information of the font in the conversion window. param2 contains the pointer to FATTRS. This pointer receives FATTRS structure for the font of the conversion window. IMC_QUERYCONVERSIONFONTSIZE : An application sends this message to IM window to query size of the font in the conversion window. param2 contains the pointer to SIZEF. This pointer receives SIZEF structure for the font of the conversion window. IMC_QUERYCONVERSIONWINDOWPOS : An application sends this message to IM window to query position of the conversion window. param2 contains the pointer to CONVERSIONPOS. This pointer receives CONVERSIONPOS structure for the position of the conversion . IMC_QUERYIMMODE : An application sends this message to IM window to query the IM mode. param2 contains the pointer to IMMODE. This pointer receives IMMODE structure for the IM mode(input mode, conversion mode and IME's on/off). Refer to ImQueryIMM the definition. IMC_QUERYSTATUSWINDOWPOS : An application sends this message to IM window to query position of the status window. param2 contains the pointer to POINTL. This pointer receives POINTL structure for the position of the status window. IMC_QUERYSTATUSWINDOWSIZE : An application sends this message to IM window to query size of the status window. param2 contains the pointer to SIZEL. This pointer receives SIZEL structure for the size of the status window. IMC_SHOWSTATUSWINDOW : An application sends this message to IM window to show the status window. param2 is reserved 0. IMC_SETCANDIDATEPOS : An application sends this message to IM window to set position of the candidate window. param2 contains the pointer to CANDIDATEPOS of the position of the candidate window. IMC_SETCONVERSIONANGLE : An application sends this message to IM window to set the writing angle in the conversion window. param2 contains the pointer to GRADIENTL of the font information of the conversion window. IMC_SETCONVERSIONFONT : An application sends this message to IM window to set the font in the conversion window. param2 contains the pointer to FATTRS of the font information of the conversion window. IMC_SETCONVERSIONFONTSIZE : An application sends this message to IM window to set the font size in the conversion window. param2 contains the pointer to SIZEF of the font information of the conversion window. IMC_SETCONVERSIONWINDOWPOS : An application sends this message to IM window to set position of the conversion window. param2 contains the pointer to CONVERSIONPOS of the conversion window position. IMC_SETIMMODE : An application sends this message to IM window to set the IM mode. param2 contains the pointer to IMMODE of the IM mode(input mode, conversion mode and IME's on/off). Refer to ImQueryIMMode for the definition. IMC_SETSTATUSWINDOWPOS : An application sends this message to IM window to set the position of the status window. param2 contains the pointer to POINTL of the status window position. param2 : This depends on each control value. Returns: Zero is successful. Others are errors. ═══ 12.3.2. WM_IMEREQUEST ═══ IMEREQUEST This message is sent to the application window for the notification of the events. Parameters : mparam1 : ulRequestType(ULONG) which is one of the following value. Each value is exclusive. IMR_INSTANCEACTIVATE : This request is sent when the application gets focus. High word of mparam2 contains the bool value of activation(TRUE : activated, FALSE : inactivated). Low word of mparam2 contains the information that which wind It is the combination of the following bits. IMR_IA_STATUS IMR_IA_CONVERSION IMR_IA_CANDIDATE IMR_IA_INFOMSG IMR_IA_REGWORD IMR_STATUS : This request is sent when the status part is changed. mparam2 contains the information that which field of the status part is changed. It is the combination of the following bits. IMR_STATUS_SHOW IMR_STATUS_HIDE IMR_STATUS_INPUTMODE IMR_STATUS_CONVERSIONMODE IMR_STATUS_STATUSPOS IMR_STATUS_STATUSSTRING IMR_STATUS_STRINGATTR IMR_STATUS_CURSORPOS IMR_STATUS_CURSORATTR IMR_CONVRESULT : This request is sent when the conversion part, result part, or both are changed as a result of the keyinput or calling API. mparam2 contains the information that which field of the conversion or result part is changed. It is the c ion of the following bits. IMR_CONV_CONVERSIONSTRING IMR_CONV_CONVERSIONATTR IMR_CONV_CONVERSIONCLAUSE IMR_CONV_READINGSTRING IMR_CONV_READINGATTR IMR_CONV_READINGCLAUSE IMR_CONV_CURSORPOS IMR_CONV_CURSORATTR IMR_CONV_CHANGESTART IMR_CONV_INSERTCHAR IMR_CONV_NOMOVECARET IMR_CONV_CONVERSIONFONT IMR_CONV_CONVERSIONPOS IMR_RESULT_RESULTSTRING IMR_RESULT_RESULTATTR IMR_RESULT_RESULTCLAUSE IMR_RESULT_READINGSTRING IMR_RESULT_READINGATTR IMR_RESULT_READINGCLAUSE IMR_CANDIDATE : This request is sent when the candidate part is changed. mparam2 contains the information that which field of the candidate part is changed. It is the combination of the following bits. IMR_CANDIDATE_SHOW IMR_CANDIDATE_HIDE IMR_CANDIDATE_CHANGE IMR_CANDIDATE_CANDIDATEPOS IMR_CANDIDATE_SELECT Note: IMR_CANDIDATE_SELECT is sent when just a selection in a candidate list is changed. When all contents of the candidate list is changed, IMR_CANDIDATE_CHANGE is sent. IMR_INFOMSG : This request is sent when the information message part is changed. IMR_INFOMSG_ERRLEVEL IMR_INFOMSG_ERRINDEX IMR_INFOMSG_ERRTITLE IMR_INFOMSG_ERRSTR IMR_INFOMSG_PRIVATE IMR_REGWORD : This request is sent when the register word part is changed. IMR_REGWORD_SHOW IMR_REGWORD_HIDE IMR_IMECHANGE : This request is sent when the currentIME is changed. mparam2 contains an ImeId of a new IME. IMR_CONFIG : This request is sent when the configuration panel of the IME is shown or hidden. IMR_CONFIG_SHOW IMR_CONFIG_HIDE IMR_DICTIONARY : This request is sent when the dictionary setting panel is shown or hidden. IMR_DICTIONARY_SHOW IMR_DICTIONARY_HIDE IMR_OTHERINFO : This request is sent when information which doesn't belong to any part is changed. IMR_OTHERINFO_HWND mparam2 : depends on ulRequestType. Returns : Success indicator(BOOL) : TRUE : success. FALSE : failure Remarks : In Windows95, WM_IME_COMPOSITION contains 'chDBCS' which is the latest change to the composition string. But it is always zero when IME is MSIME. So we omitted this parameter on IMR_COMVERSION and IMR_RESULT request. ═══ 12.3.3. WM_IMENOTIFY ═══ IMENOTIFY This message is sent to the application for the notification of the IME Window related events. Parameters : mparam1 : ulNotification which is one of the following IMN_STARTCONVERSION : This notification is sent when the Conversion Window is about to be created.This message is sent by IME. IMN_ENDCONVERSION : This notification is sent when the Conversion Window is about to be destroyed.This message is sent by IME. IMN_CONVERSIONFULL : This notification is sent when no space is available for the Conversion Window.This message is sent by IME Window(Conversion part). IMN_IMECHANGED : This notification is sent when the IME has been changed. This message is sent by the system. mparam2 contains an ImeId of the new IME. Returns : Success indicator(BOOL) : TRUE : success. FALSE : failure Remarks : ═══ 12.4. Structures ═══ ═══ 12.4.1. CANDIDATELISTHEADER ═══ CANDIDATELISTHEADER typedef struct _CANDIDATELISTHEADER{ ULONG ulSize; ULONG ulStyle; ULONG ulCount; ULONG ulSelection; ULONG ulPageStart; ULONG ulPageSize; ULONG ulTitleLen; ULONG ulTitleOffset; ULONG aulOffset[1]; }CANDIDATELISTHEADER; typedef CANDIDATELISTHEADER * PCANDIDATELISTHEADER; ulSize - size of this structure, in bytes. ulStyle - style of the candidate list. This could be one of the following. ┌───────────────┬──────────────────────────────────────────────────┐ │Style │Description │ ├───────────────┼──────────────────────────────────────────────────┤ │CLS_READING │The list of the same reading candidates. │ ├───────────────┼──────────────────────────────────────────────────┤ │CLS_CODE │The list of the same code range candidates. │ ├───────────────┼──────────────────────────────────────────────────┤ │CLS_MEANING │The list of the same meaning candidates. │ ├───────────────┼──────────────────────────────────────────────────┤ │CLS_RADICAL │The list of the same radical candidates. │ ├───────────────┼──────────────────────────────────────────────────┤ │CLS_STROKES │The list of the same strokes candidates. │ └───────────────┴──────────────────────────────────────────────────┘ ulCount - number of the candidates. ulSelection - index of the selected candidate string. ulPageStart - index of the first candidate string in the candidate window. ulPageSize - number of the candidate strings in one candidate window. ulTitleLen - length of a title of this candidate list. ulTitleOffset - offset form top of this structure(in bytes). The title is put here. aulOffset - candidate strings(0 terminated) will be followed. ═══ 12.4.2. CONVERSIONPOS ═══ CONVERSIONPOS typedef struct _CONVERSIONPOS{ ULONG ulStyle; POINTL ptCurrentPos; RECTL rcArea; }CONVERSIONPOS; typedef CONVERSIONPOS * PCONVERSIONPOS; ulStyle - style of the position. This is bit definition. ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Style │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CPS_DEFAULT │Display the conversion window at the default │ │ │position │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CPS_FORCE │Display the conversion text box at the position │ │ │given in ptCurrentPos │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CPS_POINT │Display the conversion window at the position │ │ │given in ptCurrentPos │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CPS_RECT │Display the conversion window at the area given in│ │ │rcArea │ └──────────────────────────────┴──────────────────────────────────────────────────┘ ptCurrentPos - coordinates of the bottom-left cor ner of the conversion window. When the ulStyle is CPS_FORCE, this is the coordinates of the bottom-left corner of the conversion text box (in window coordinate). rcArea - rectangle of the conversion window ═══ 12.4.3. CANDIDATEPOS ═══ CANDIDATEPOS typedef struct _CANDIDATEPOS{ ULONG ulIndex; ULONG ulStyle; POINTL ptCurrentPos; RECTL rcArea; }CANDIDATEPOS; typedef CANDIDATEPOS * PCANDIDATEPOS; ulIndex - index of the candidate list. This could be the number from 0 to 31. ulStyle - style of the position of the candidate window. ┌──────────────────────────────┬──────────────────────────────────────────────────┐ │Style │Description │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CPS_CANDIDATEPOS │Display the candidate window at position which │ │ │upper-left corner is ptCurrentPos. │ ├──────────────────────────────┼──────────────────────────────────────────────────┤ │CPS_EXCLUDE │Exclude the candidate window from area given in │ │ │rcArea. And ptCurrentPos means the current cursor │ │ │position. │ └──────────────────────────────┴──────────────────────────────────────────────────┘ ptCurrentPos - coordinates of the upper-left corner of the candidate window, or the cursorposition. It depends on ulStyle. (in window coordinate) rcArea - rectangle of the exclusion area for CPS_EXCLUDE. ═══ 12.4.4. IMEINFOHEADER ═══ IMEINFOHEADER typedef struct _IMEINFOHEADER { ULONG cbSize; CHAR szIMEName[IMENAMESIZE]; ULONG ulCodePageCount; ULONG offsetCodePage; ULONG ulDescriptionLen; ULONG offsetDescription; ULONG ulFlag; } IMEINFOHEADER; typedef IMEINFOHEADER * PIMEINFOHEADER; cbSize - size of this structure, in bytes. szIMEName - IMEName, which is a file name of DLL of the IME without extension. ulCodePageCount - count of Code pages which the IME supports. offsetCodePage - offset from top of this structure(in bytes). The code pages are put here. ulDescriptionLen - length of a description of the IME. offsetDescription - offset from top of this structure(in bytes). The description are put here. ulFlag - flag. For system use only. ═══ 12.4.5. WORDTYPE ═══ WORDTYPE typedef struct _WORDTYPE{ ULONG ulType; CHAR szDescription[32]; }WORDTYPE; typedef WORDTYPE * PWORDTYPE; ulType - type of word szDescription - description about ═══ 12.4.6. REGISTERWORDHEADER ═══ REGISTERWORDHEADER typedef struct _REGISTERWORDHEADER{ ULONG cbSize ULONG ulLengthReading; ULONG ulOffsetReading; ULONG ulLengthWord; ULONG ulOffsetWord; }REGISTERWORDHEADER; typedef REGISTERWORDHEADER * PREGISTERWORDHEADER; cbSize - size of this structure ulLengthReading - length of reading string in bytes. ulOffsetReading - offset from top of this structure in bytes for the reading string. ulLengthWord - length of word to register in bytes. ulOffsetWord - offset from top of this structure in bytes for the word. ═══ 12.4.7. IMMODE ═══ IMMODE typedef struct _IMMODE{ ULONG ulInputMode; ULONG ulConversionMode; } IMMODE; typedef IMMODE * PIMMODE; ulInputMode and ulConversionMode are the same definition as the parameters of ImQueryIMMode. Please refer to this. Comparison with Win95 APIs Messages ═══ APIs ═══ ┌────────────────────────────────────────┬────────────────────────────────────────┐ │Win95 │OS/2 │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmAssociateContext │ImAssociateInstance │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmConfigureIME │ImShowIMEDlg │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmCreateContext │ImCreateInstance │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmDestroyContext │ImDestroyInstance │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmEnumRegisterWord │ImEnumRegisterWord │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmEscape │ImEscape │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetCandidateList │ImQueryCandidateList │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetCandidateListCount │ImQueryCandidateList *1 │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetCandidateWindow │ImQueryCandidateWindowPos │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetCompositionFont │ImQueryConversionFont │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetCompositionString │ImGetConversionString │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │ImGetResultString │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetCompositionWindow │ImQueryConversionWindowPos │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetContext │ImGetInstance │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetConversionList │ImConvertString │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetConversionStatus │ImQueryIMMode │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetDefaultIMEWnd │ImQueryDefaultIMWindow │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetDescription │ImQueryIMEInfo │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetGuideLine │ImQueryInfoMsg │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetIMEFileName │ImQueryIMEInfo *2 │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetOpenStatus │ImQueryIMMode │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetProperty │ImQueryIMEProperty │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetRegisterWordStyle │ImQueryRegisterWordType │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetStatusWindowPos │ImQueryStatusWindowPos │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmGetVirtualKey │N/A │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmInstallIME │ImRegisterIME │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmIsIME │N/A │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmIsUIMessage │ImIsIMEMessage │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmNotifyIME │ImRequestIME │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmRegisterWord │ImRegisterWord │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmReleaseContext │ImReleaseInstance │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmSetCandidateWindow │ImSetCandidateWindowPos │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmSetCompositionFont │ImSetConversionFont │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmSetCompositionString │ImSetConversionString │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmSetCompositionWindow │ImSetConversionWindowPos │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmSetConversionStatus │ImSetIMMode │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmSetOpenStatus │ImSetIMMode *3 │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmSetStatusWindowPos │ImSetStatusWindowPos │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmSimulateHotKey │N/A │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImmUnregisterWord │ImDeregisterWord │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImDeregisterIME │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImQueryCurrentIME │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImQueryIMEList │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImSetCurrentIME │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImShowStatusWindow │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImQueryMsgQueueProperty │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImSetMsgQueueProperty │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImGetStatusString │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImQueryIMEID │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImQueryDefaultIME │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │N/A │ImSetDefaultIME │ └────────────────────────────────────────┴────────────────────────────────────────┘ Note: *1 ImQueryCandidateList has functions which correspond to ImmQueryCandidateList and ImmQueryCandidateListCount. Note: *2 ImQueryIMEInfo has functions which correspond to ImmGetDescription and ImmGetIMEFileName. Note: *3 ImSetIMMode has functions which correspond to ImmSetConversionStatus and ImmSetOpenStatus. ═══ Messages ═══ ┌────────────────────────────────────────┬────────────────────────────────────────┐ │Win95 │OS/2 Remarks │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_IME_CHAR │WM_CHAR │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_IME_COMPOSITION │IMR_CONVRESULT │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_IME_COMPOSITIONFULL │IMN_CONVERSIONFULL │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_IME_CONTROL │WM_IMECONTROL │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_IME_ENDCOMPOSITION │IMN_ENDCONVERSION │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_IME_NOTIFY │WM_IMEREQUEST │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_IME_SELECT │ │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_IME_SETCONTEXT │IMR_INSTANCEACTIVATE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_IME_STARTCOMPOSITION │IMN_STARTCONVERSION │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_CLOSESTATUSWINDOW │IMC_CLOSESTATUSWINDOW │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_GETCANDIDATEPOS │IMC_QUERYCANDIDATEPOS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_GETCOMPOSITIONCOLOR │IMC_QUERYCONVERSIONCOLOR │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_GETCOMPOSITIONFONT │IMC_QUERYCONVERSIONFONT │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_GETCOMPOSITIONWINDOW │IMC_QUERYCONVERSIONWINDOW │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_GETCONVERSIONMODE │IMC_QUERYCONVMODE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_GETOPENSTATUS │IMC_QUERYOPENSTATUS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_GETSENTENCEMODE │IMC_QUERYSENTENCEMODE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_GETSTATUSWINDOWPOS │IMC_QUERYSTATUSWINDOWPOS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_OPENSTATUSWINDOW │IMC_OPENSTATUSWINDOW │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_SETCANDIDATEPOS │IMC_SETCANDIDATEPOS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_SETCOMPOSITIONCOLOR │IMC_SETCONVERSIONCOLOR │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_SETCOMPOSITIONFONT │IMC_SETCONVERSIONFONT │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_SETCOMPOSITIONWINDOW │IMC_SETCONVERSIONWINDOW │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_SETCONVERSIONMODE │IMC_SETCONVMODE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_SETOPENSTATUS │IMC_SETOPENSTATUS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_SETSENTENCEMODE │IMC_SETSENTENCEMODE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMC_SETSTATUSWINDOWPOS │IMC_SETSTATUSWINDOWPOS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_CHANGECANDIDATE │IMR_CANDIDATE_CHANGE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_CLOSECANDIDATE │IMR_CANDIDATE_HIDE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_CLOSESTATUSWINDOW │IMR_STATUS_HIDE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_GUIDELINE │IMR_INFOMSG │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_INFOMSG_ERRLEVEL │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_INFOMSG_ERRINDEX │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_INFOMSG_ERRSTR │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_INFOMSG_PRIVATE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_OPENCANDIDATE │IMR_CANDIDATE_SHOW │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_OPENSTATUSWINDOW │IMR_STATUS_SHOW │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_SETCANDIDATEPOS │IMR_CANDIDATE_CANDIDATEPOS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_SETCOMPOSITIONFONT │IMR_CONV_CONVERSIONFONT │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_SETCOMPOSITIONWINDOW │IMR_CONV_CONVERSIONPOS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_SETCONVERSIONMODE │IMR_STATUS_INPUTMODE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_SETOPENSTATUS │IMR_STATUS_INPUTMODE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_SETSENTENCEMODE │IMR_STATUS_CONVERSIONMODE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IMN_SETSTATUSWINDOWPOS │IMR_STATUS_STATUSPOS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMC_QUERYSTATUSWINDOWSIZE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMC_QUERYCONVERSIONANGLE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMC_QUERYCONVERSIONFONTSIZE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMC_SETCONVERSIONANGLE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMC_SETCONVERSIONFONTSIZE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMC_CHANGEINPUTLANG │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_IMECHANGE │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_STATUS_STATUSSTRING │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_STATUS_STRINGATTR │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_STATUS_CURSORPOS │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_STATUS_CURSORATTR │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMR_OTHERINFO_HWND │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ │IMN_IMECHANGED │ └────────────────────────────────────────┴────────────────────────────────────────┘ ═══ 13. 32 bit Input Method Editor Interface ═══ ═══ 13.1. Overview ═══ Input Method Editor(IME) is a pre-processor for the user input events, which typically gets the keyboard inputs, performs some editing or conversion, and finally return the result data to the application. IME is an OS/2 DLL which exports 32 bit ImeXXX entries(required) and provides IME Window class if exists. Compared to the legacy 16 bit IME interface, new 32 bit IME interface has the following features. - IME can get every keystrokes regardless of the input mode by default. - IME can provide display services for PM environment, e.g., intermediate string during the conversion, candidate list, etc. - No management needed for IME handles. System will provide the data fields for each Input Method Instance which is described later. Above picture depicts the conceptual block diagram of applications, system and IME. As seen in the above picture, IME can be called from 3 different environments, i.e., PM, FullScreen, and DOS. When a session is created in each environment(in case of PM, each frame window), system creates an Input Method Instance by default. If there is a default IME whose support language matches the application's language which is related to the application's codepage (In case of FullScreen and Dos, it is the process codepage. In case of PM, it is the input queue codepage), that IME is loaded by the system and notified that the IMInstance is created. IMInstance can also be created by the ImCreateInstance called by the application, which consequently notifies IME of that instance creation. When the user inputs some keystrokes, IME is notified of those events through ImeNotifyEvent call. IME may process those keystrokes and may generate some display requests which contain the information about conversion intermediate string, conversion candidates, input mode status, etc. by ImRequestEvent call. These display requests are transferred to IMMON.EXE which is a keyboard monitor program for FullScreen application, or to the Bridge process for the MVDM, or PM application. Each display data itself is stored within IMInstance as a handle which is related to a memory block(which is called as Part). In case of PM, if IME has the display capability, those display requests are transferred back to IME's window (which is called as IMEWindow) as PM messages. Then IME displays them by its own user interface. Also IME may generate the result string which needs to be delivered to the application. The result string can be delivered to the application either a form of string or a combination of some WM_CHARs. Because IME should be callable from non-PM environment, ImeXXX call should not call any of PM related calls unconditionally. If there is a need to call PM APIs with in any of the ImeXXX calls, check that the current IMInstance's session type is PM. That information is kept in IMInstance. ═══ 13.1.1. Input Method Instance ═══ Input Method Instance Input Method Instance is a contextual unit which holds the several states related to the user input. It is actually a data block which is allocated by system. The data structure is directly accessible through a long value handle(HIMI) by calling ImRequestIMInstance, which gives IME the memory address of the structure. After IME refers to or change the IMInstance contents, IME should release IMInstance by calling ImReleaseIMInstance call. IMInstance itself has the following structure. IMINSTANCE { /* Size of this structure */ ULONG ulSize; /* Information related to the client application */ ULONG ulSessionType; HWND hwnd; ULONG ulSessionID; ULONG ulClientInfo; ULONG ulCodepage; /* Status part */ HIMIP himipStatus; ULONG ulInputMode; ULONG ulConversionMode; POINTL ptlStatusPos; SIZEL slStatusSize; /* Conversion part */ HIMIP himipConversion; FATTRS faConversionWindow; GRADIENTL gradlConversionWindow; SIZEF sfCharBox; CONVERSIONPOS cpConversionPos; /* Result part */ HIMIP himipResult; /* Candidate part */ HIMIP himipCandidate; CANDIDATEPOS cpCandidatePos; /* Information message part */ HIMIP himipInfoMsg; /* Register word part */ HIMIP himipRegWord; /* Private part */ HIMIP himipPrivate; } where ulSize : Size of this structure ulSessionType : Session Type of the client. The value in this field is identical to the one which is used inDosGetInfoBlocks( pib_ulType ) (Provider : System, Viewer : IME) hwnd :Window handle. This field is valid when the IMI_CI_PMCALLABLE is set in ulClientInfo. (Provider : System, Viewer : IME.) SessionID : Session id. This field is valid when the IMI_CI_PMCALLABLE is *NOT* set in ulClientInfo. (Provider : System, Viewer : IME.) ulClientInfo : Bit field for the client information as follows. (Provider : System, Viewer : IME.) IMI_CI_PMCALLABLE(0x00000001) : IME can call PM APIs for this instance. ulCodepage : Codepage of the client application. It is the queue codepage if the client is PM app, or the process codepage if the client is FullScreen app. IME need not care whether the codepage is a member of the IME supported language or not. If epage is not a member of supported IME language, IME is automatically changed(detached) by the system. Provider : System, Viewer : IME. himipStatus : IMIPart handle of the Status part. (Provider : IME Viewer : IME.) ulInputMode : Contains the current keyboard mode. If the value of this field is altered by system, IME will get notified by ImeNotifyEvent call, also if IME alter this field, IME should call ImRequestEvent with IMR_STATUS_INPUTMODE. The bit defini as follows Provider : System, IME Viewer : IME, System. Bit 0-4 : NLS Layer mode. 0 : IMI_IM_NLS_ALPHANUMERIC(0x00000000) 1 : IMI_IM_NLS_HIRAGANA(0x00000001) 1 : IMI_IM_NLS_TAIWAN(0x00000001) 1 : IMI_IM_NLS_PRC(0x00000001) 1 : IMI_IM_NLS_HANGEUL(0x00000001) 3 : IMI_IM_NLS_KATAKANA(0x00000003) Bit 5 : Character width. 0 : IMI_IM_WIDTH_HALF(0x00000000) 1 : IMI_IM_WIDTH_FULL(0x000000020) Bit 6 : Romaji mode 0 : IMI_IM_ROMAJI_OFF(0x00000000) 1 : IMI_IM_ROMAJI_ON(0x00000040) Bit 7 : System Romaji Conversion enable/disable flag 0 : IMI_IM_SYSTEMROMAJI_ENABLE(0x00000000) 1 : IMI_IM_SYSTEMROMAJI_DISABLE(0x00000080) Bit 8 : IME mode which has one of the following values 0 : IMI_IM_IME_OFF(0x00000000) 1 : IMI_IM_IME_ON(0x00000100) Bit 9 : IME enable/disable flag. If IME is disabled, IME is not called from system, but IME is still attached to the instance. 0 : IMI_IM_IME_ENABLE(0x00000000) 1 : IMI_IM_IME_DISABLE(0x00000200) Bit 10 : Soft-Keyboard ON/OFF. If this bit is ON, the new filled soft-keyboard part class window will be appear.(PRC Only) 0 : IMI_IM_IME_SOFTKBD_OFF(0x00000000) 1 : IMI_IM_IME_SOFTKBD_ON(0x00000400) Bit 11 : IME Chinese Symbol Input ON/OFF. If this bit is ON, some alphanumeric punctuations inputed from keyboard will be converted into DBCS punctuation by IME. It is filled in IME.(PRC Only) 0 : IMI_IM_IME_CSYMBOL_OFF(0x00000000) 1 : IMI_IM_IME_CSYMBOL_ON(0x00000800) Bit 12-31 : Reserved zero ulConversionMode : Contains the conversion logic method. If the value of this field is altered by system, IME will get notified by ImeNotifyEvent call, also if IME alter this field, IME should call ImRequestEvent with IMR_STATUS_CONVERSIONMODE. The finition is as follows. Provider : System, IME Viewer : IME, System. IMI_CM_AUTOMATIC IME is in automatic conversion mode IMI_CM_PLURALCLAUSE IME is in plural clause conversion mode IMI_CM_PREDICT IME is in phrase predict conversion mode IMI_CM_SINGLE IME is in single character conversion mode ptlStatusPos : Position of the status window in World Coordinates. If the value of this field is altered by system, IME will get notified by ImeNotifyEvent call, also if IME alter this field, IME should call ImRequestEvent with IMR_STATUS_STATUSPOS ider : System, IME Viewer IME, System.) slStatusSize : Status Window width and height. If IME alter this field, IME should call ImRequestEvent with IMR_STATUS_STATUSPOS. (Provider : IME Viewer : System) himipConversion : IMIPart handle of the Conversion part. (Provider : IME Viewer : IME.) faConversionWindow : Font Attribute which is used for the conversion window. If the value of this field is altered by system, IME will get notified by ImeNotifyEvent call, also if IME alter this field, IME should call ImRequestEvent with IMR_CONV_CONVERSIONFONT. (Provider : System, IME Viewer : IME, System.) gradlConversionWindow : conversion window angle. sfCharBox : Character box size(in PELs) of the font which is used in the conversion window. cpConversionPos : Position and clipping rect definition for the conversion window in Window Coordinates. If the value of this field is altered by system, IME will get notified by ImeNotifyEvent call, also if IME alter this field, IME should call ImRequestEvent with IMR_CONV_CONVERSIONPOS. (Provider : System, IME Viewer : IME, System.) himipResult : IMIPart handle of the Result part. (Provider : IME Viewer : IME.) himipCandidate : IMIPart handle of the Candidate part. (Provider : IME Viewer : IME.) cpCandidatePos : Position and clipping rect definition of the candidate window in Window Coordinates. If the value of this field is altered by system, IME will get notified by ImeNotifyEvent call, also if IME alter this field, IME should call ImRequestEvent with IMR_CONV_CONVERSIONPOS. (Provider : System, IME Viewer : IME, System.) himipInfoMsg : IMIPart handle of the Informational Message part. (Provider : IME Viewer : IME.) himipRegWord : IMIPart handle of the Register Word part. (Provider : IME Viewer : IME.) himipPrivate : IMIPart handle of the Private part. (Provider : IME Viewer : IME.) Note: IME should check client information such as hwnd and SessionID even if IME does not set IME_CAPS_SCREENSWITCHABLE on each IMInstance request, because application can associate the instance to any client at any time. ═══ 13.1.2. Part ═══ Part There are six pre-defined Parts and one private part to store the instance specific data. Each part data area is allocated by calling ImCreateIMIPart and destroyed by calling ImDestroyIMIPart. Data itself is accessible through ImRequestIMIPart and ImReleaseIMIPart calls (The exception is the Status part). Creating each part is IME's responsibility. Status Part This part is used to keep the current input related status information. Status part data may contain any string for displaying IME status. STATUSSTRINGHEADER { ULONG ulSize; ULONG ulStringLen; ULONG ulStringOffset; ULONG ulStringAttrOffset; ULONG ulCursorPos; ULONG ulCursorAttr; } where ulSize : Size of this structure. ulStringLen : String and attribute buffer length in bytes. ulStringOffset : Offset of the string buffer. ulStringAttrOffset : Offset of the string attribute buffer ulCursorPos : Cursor position in bytes ulCursorAttr : Cursor attribute Attributes in ulStringAttrOffset have the same definition with ImGetStatusString API. Conversion Part This part is used to hold the conversion intermediate data. Basically this part contains two information and those attributes, i.e., the current intermediate converted string and its reading information. CONVERSIONSTRINGHEADER { ULONG ulSize; ULONG ulReadingAttrLen; ULONG ulReadingAttrOffset; ULONG ulReadingClauseLen; ULONG ulReadingClauseOffset; ULONG ulReadingStringLen; ULONG ulReadingStringOffset; ULONG ulConversionAttrLen; ULONG ulConversionAttrOffset; ULONG ulConversionClauseLen; ULONG ulConversionClauseOffset; ULONG ulConversionStringLen; ULONG ulConversionStringOffset; ULONG ulCursorPos; ULONG ulCursorAttr; ULONG ulChangeStart } where ulSize : Size of this structure. ulReadingAttrLen : Reading attribute buffer length. ulReadingAttrOffset : Offset of the reading attribute buffer. ulReadingClauseLen : Reading Clause buffer length. ulReadingClauseOffset : Offset of the Reading Clause buffer ulReadingStringLen : Reading string buffer length ulReadingStringOffset : Offset of the Reading String buffer ulConversionAttrLen : Conversion attribute buffer length. ulConversionAttrOffset : Offset of Conversion attribute buffer. ulConversionClauseLen : Conversion clause buffer length. ulConversionClauseOffset : Offset of Conversion clause buffer ulConversionStringLen : Conversion string buffer length ulConversionStringOffset : Offset of Conversion string buffer ulCursorPos : Cursor position in bytes ulCursorAttr : Cursor attribute ulChangeStart : Starting position of the changes in bytes Attributes and Clause in Reading and Conversion fields have the same definition with ImGet/SetConversionString API. Result Part This part is filled with the data which is already converted and ready to be delivered to the application. RESULTSTRINGHEADER { ULONG ulSize; ULONG ulReadingAttrLen; ULONG ulReadingAttrOffset; ULONG ulReadingClauseLen; ULONG ulReadingClauseOffset; ULONG ulReadingStringLen; ULONG ulReadingStringOffset; ULONG ulResultAttrLen; ULONG ulResultAttrOffset; ULONG ulResultClauseLen; ULONG ulResultClauseOffset; ULONG ulResultStringLen; ULONG ulResultStringOffset; } where ulSize : Size of this structure ulReadingAttrLen : Reading attribute length ulReadingAttrOffset : Offset of Reading attribute ulReadingClauseLen : Reading clause length ulReadingClauseOffset : Offset of Reading clause ulReadingStringLen : Reading string length ulReadingStringOffset : Offset of Reading string ulResultAttrLen : Result attribute length ulResultAttrOffset : Offset of Result attribute ulResultClauseLen : Result clause length ulResultClauseOffset : Offset of Result clause ulResultStringLen : Result string length ulResultStringOffset : Offset of Result string Attributes and Clause in Reading and Result fields have the same definition with ImQuery/SetResultString API. Candidate Part This part has the list of the conversion candidates. CANDIDATEINFOHEADER { ULONG ulSize; ULONG ulCount; ULONG ulListOffset[32]; ULONG ulPrivateSize; ULONG ulPrivateOffset; } where ulSize : Size of this structure ulCount : Count of candidate lists ulListOffset : Offsets of each candidate lists. ulPrivateSize : Size of Private data area ulPrivateOffset : Offset of Private data area Each ulListOffset points to the candidate list structure which is described in IM Interface section. InfoMsg Part This part has the informational message which should be popped up. INFOMSGHEADER { ULONG ulSize; ULONG ulErrorLevel; ULONG ulTypeID; ULONG ulTitleLen; ULONG ulTitleOffset; ULONG ulStringLen; ULONG ulStringOffset; ULONG ulPrivateLen; ULONG ulPrivateOffset; } where ulSize : Size of this structure ulErrorLevel : Error level ulTypeID : Error type index ulTitleLen : Error title length ulTitleOffset : Offset of error title ulStringLen : Error message length ulStringOffset : Offset of Error message ulPrivateLen : Private data area length ulPrivateOffset : Offset of Private data area Value definitions of ulErrorLevel and ulTypeID are described in ImQueryInfoMsg API. Register Word Part This part has the initial information to dispaly the register word panel. REGISTERWORDHEADER { ULONG ulSize; ULONG ulReadingLen; ULONG ulReadingOffset; ULONG ulWordLen; ULONG ulWordOffset; } where ulSize : Size of this structure ulReadingLen : register word reading length ulReadingOffset : Offset of the register word reading ulWordlen : register word string length ulWordOffset : Offset of the register word string Private Part This part contains the IME specific data. ═══ 13.1.3. IME Window ═══ IME Window IME Window is an object window to receive any of the IME user interface related message in PM environment. Its main purpose is to receive display request event messages from Application, System or IME itself. If IME Window receives those request, IME Window communicates with the appropriate part windows(described below) to show the part contents. IME Window class is provided by IME and it is registered by the system at ImeInitialize timing. When an IMInstance is created, IME Window is automatically created by the system and it has following window words: - QWL_IMEW_HIMI - to retrieve IMInstance handle - QWL_IMEW_PRIVATE - to save IMInstance specific data - QWL_IMEW_HWNDSTATUS - to retrieve the default status window - QWL_IMEW_HWNDCONVERSION - to retrieve the default conversion window - QWL_IMEW_HWNDCANDIDATE - to retrieve the default candidate window - QWL_IMEW_HWNDINFOMSG - to retrieve the default InfoMsg window - QWL_IMEW_HWNDREGWORD - to retrieve the default RegWord window IME Window is able to retrieve the IMInstance handle to access the IMInstance data, by calling WinQueryWindowULong with QWL_IMEW_HIMI, except that QWL_HIMI field does not contain IMInstance handle at WM_CREATE message. IME Window also have 4 byte area to hold instance specific data. It is accessible through QWL_IMEW_PRIVATE. Other window words represents the window handle of each default part class which is supplied by the system. These areas are filled when the system needs to pass the WM_IMEREQUEST message to each part class. (Usually, it is IMR_INSTANCEACTIVATE event) There is an option not to provide IME Window class if IME does not want to display any unique user interface. In that case the system creates the default IME Window and its Part Windows, i.e., default user interface is used. System provides WinDefImeWndProc (See below) for the default window procedure for IME Window class. Typical IME Window procedure looks like follows: MRESULT APIENTRY MyImeWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ) { switch ( msg ) { case WM_CREATE: // allocate private memory for this IMInstance. pPrivate = alloc(); WinSetWindowULong(hwnd, QWL_IMEW_PRIVATE, pPrivate); break; case WM_DESTROY: // free private memory pPrivate = WinQueryWindowULong(hwnd, QWL_IMEW_PRIVATE); free( pPrivate ); break; case WM_QUERYIMEWINDOWCAPS: switch ( (ULONG)mp1 ) { case IWC_CONVERSIONANGLE: *((PULONG)mp2) = UIC_ANGLEANY; return (MRESULT)TRUE; case IWC_CONVERSIONMARGIN: *((PULONG)mp2) = MARGIN; return (MRESULT)TRUE; case IWC_FORCEPOSITION: *((PULONG)mp2) = TRUE; return (MRESULT)TRUE; } break; case WM_IMEREQUEST: pPrivate = WinQueryWindowULong(hwnd, QWL_IMEW_PRIVATE); // IME specific processing. // WinDefImeWindowProc can be callable if IME needs the // default processing. : break; case WM_IMECONTROL: case WM_IMENOTIFY: // IME Window does not expect to see these messages. break; default: return WinDefImeWindowProc( hwnd, msg, mp1, mp2 ); } return (MRESULT)FALSE; } ═══ 13.1.4. WinDefImeWindowProc ═══ WinDefImeWindwoProc This is the window procedure for the IME Window. IME Window should use this default procedure instead of WinDefWindowProc. WinDefImeWindowProc dispatches the IME related messages to the default part windows. IME Window should not pass IME Related message s if IME does not want default action for those messages. For the default actions of the part windows, refer to the later section. WinDefImeWindowProc's calling syntax is as follows. MRESULT APIENTRY WinDefImeWindowProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); ═══ 13.1.5. Part Windows ═══ Part Windows IME can freely display any type of PM window for displaying the Part data within IMInstance. Those windows are called as Part Windows, e.g., if IME displays an intermediate conversion string, that window can be called as Conversion Part Window. The default window procedure for part windows is WinDefImePartProc instead of WinDefWindowProc. System also provide the pre-defined Part Window Classes for IME as follows. - WC_IME_STATUS - WC_IME_CONVERSION - WC_IME_CANDIDATE - WC_IME_INFOMSG - WC_IME_REGWORD In case that IME uses the system pre-defined part window, IME should take care of the following things: - The owner window of those pre-defined Part windows should be the IME Window. - IME Window should pass the messages that are related to those part windows to WinDefImeWindowProc. WinDefImePartProc's calling syntax is as follows. MRESULT APIENTRY WinDefImePartProc( HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2 ); ═══ 13.2. Initialization of IME ═══ When some IME is a default IME for some language, and some application starts with that language, System will load that IME. After loading of that IME, ImeInitialize is called for the global initialization. With this call, IME can be able to notify the system of its capabilities and IME Window related information, i.e., class name and the function name of the window procedure. Following picture shows the global IME initialization. If IME provides the IME Window class name and its window procedure name, system will register that class for IME as a PUBLIC-like class by registering the class for each loaded process. Because the system queries the window procedure address by its function name, IME should explicitly export that entry with the function name. As seen in the above picture, ImeInitialize is called after the _DLL_InitTerm entry if IME have. IME should not issue any of the PM APIs which require PM message queue within _DLL_InitTerm entry, otherwise the system cannot boot up in FullScreen mode only(no-PM environment). After the global initialization, ImeNotifyEvent with IME_NE_ATTACHIME is called for each instance initialization. IME should minimize its instance initialization for the best system performance. ═══ 13.3. Termination of IME ═══ When IME is no more needed, i.e., no IMInstance refers to that IME, IME is freed from memory by DosFreeModule call. To let IME have the opportunity to clean up the global data, ImeTerminate is called just before the last DosFreeModule. ═══ 13.4. Memory management ═══ IME should be callable across the processes, the instance data of IME should be kept in shared memory. It is safe to use the Private Part(which can be allocated by ImCreateIMIPart function) to hold such instance data in IMInstance. ═══ 13.5. IME Event Handling ═══ When IME gets some event through ImeNotifyEvent call, usually IME changes the IM instance contents and then calls appropriate ImRequestEvent so that the system will route WM_IMEREQUEST or WM_IMENOTIFY message. Sample pseudo code will look like this, ImeNotifyEvent( EventType ) { switch( EventType ) { case SomeEvent: /* IME logic(i.e. no display) processing */ ImRequestIMInstance(); ImRequestIMIPart(); /* if required */ /* Reflect the processing in instance */ ImReleaseIMIPart(); /* if required */ ImReleaseIMInstance(); /* Request event to route */ ImRequestEvent( RequestEvent type for 'SomeEvent' ); break; : } return NO_ERROR; } If IME does not call ImRequestEvent for events which needs display change, L3 application(also the default part classes) cannot show IME related display. ═══ 13.6. IME Interface ═══ ═══ 13.6.1. IME Exported Entries ═══ IME Exported Entries Here are the specification of IME exported entries which IME must provide. These entries are only callable from the system, i.e., not directly callable from the application. Because IME is callable from non-PM environment, such as FS or DOS, IME should not issue any of the PM related calls which require the PM message queue. IME must export all of the API entries listed below. There are functions which are not mandatory to support. Those functions can be distinguished by the return code. If the error code ERROR_NOT_SUPPORTED is available in some function, it means that the function is not mandatory. ImeConvertString ImeDeregisterWord ImeDialog ImeEnumRegisterWord ImeEscape ImeInitialize ImeNotifyEvent ImeQueryRegisterWordType ImeRegisterWord ImeSetConversionString ImeTerminate ═══ 13.6.1.1. ImeConvertString ═══ ImeConvertString This entry is called to convert the given input string. Format: APIRET APIENTRY ImeConvertString( HIMI hImi, PSZ pszInput, PCANDIDATELISTHEADER pCandidateListHeader, PULONG pulBufferLength, ULONG ulFlag ) Parameters: hImi(input) : IMInstance handle. pszInput(input) : Input string to be converted pCandidateListHeader(output) : Conversion result. pulBufferLength(input/output) : On input, length of pCandidateList is required. On output, total buffer size in bytes which is actually copied to pCandidateList is returned. If this parameter is zero on input, total buffer size for whole CandidateL returned. ulFlag(input) : Request type which is one of the followings ICS_CONVERSION - Reading string -> Result string ICS_REVERSECONVERSION - Result string -> Reading String Returns: Success indicator 0 : Successful completion other : Error occurred ERROR_NOT_SUPPORTED : This function is not supported. Remarks: IME Should not call ImRequestEvent call. This API is used just for getting a conversion result for Level 3 applications. ═══ 13.6.1.2. ImeDeregisterWord ═══ ImeDeregisterWord This entry is called to De-register a previously registered word with its reading from IME. Format: APIRET APIENTRY ImeDeregisterWord( HIMI hImi, PSZ pszWord, PSZ pszReading, ULONG ulWordType ) Parameters: hImi(input) : IMInstance handle. pszWord(input) : Word to be De-registered. pszReading(input) : Reading for pszWord. ulWordType(input) : Word type id. Returns: Success indicator 0 : Successful completion other : Error occurred ERROR_NOT_SUPPORTED : This function is not supported. Remarks: ═══ 13.6.1.3. ImeDialog ═══ ImeDialog This entry is called to open the IME related dialog panels. Format: APIRET APIENTRY ImeDialog( HIMI hImi, ULONG ulType, PREGISTERWORDHEADER pRegWord ) Parameters: hImi(input) : IMInstance handle ulType(input) : Dialog type to display. This is one of the following values. IME_DLG_CONFIG : Display a general purpose dialog. IME_DLG_REGWORD : Displays a register word dialog. IME_DLG_DICTIONARY : Displays a dictionary related dialog. pRegWord(input) : Pointer to the REGISTERWORDHEADER structure. This parameger is valid only when the ulType is IME_DLG_REGWORD. Returns: Success indicator 0 : Successful completion other : Error occurred ERROR_NOT_SUPPORTED : This function is not supported. Remarks: It is recommended that IME call ImRequestEvent to route WM_IMEREQUEST message to IME Window, and then display appropriate dialog panel. ═══ 13.6.1.4. ImeEnumRegisterWord ═══ ImeEnumRegisterWord This entry is called to enumerate the registered words. Format: APIRET APIENTRY ImeEnumRegisterWord( HIMI hImi, PSZ pszWord, PSZ pszReading, ULONG ulWordType, REGISTERWORDENUMPROC pfnCallback, PVOID pvData ) Parameters: hImi(input) : IMInstance handle. pszWord(input) : Word to be enumerated. pszReading(input) : Reading of the word to be enumerated. ulWordType(input) : Word type id to be enumerated. pfnCallback(input) : Callback entry address pvData(input) : Application data Returns: Success indicator 0 : Successful completion other : Error occurred ERROR_NOT_SUPPORTED : This function is not supported. Remarks: ═══ 13.6.1.5. ImeEscape ═══ ImeEscape This entry is provide IME aware application with the opportunity to communicate IME itself directly. Format: APIRET APIENTRY ImeEscape( HIMI hImi, ULONG ulEscape, PVOID pvData ) Parameters: hImi(input) : IMInstance handle. ulEscape(input) : Escape function type pvData(input/output) : Escape type specific data Returns: Success indicator 0 : Successful completion other : Error occurred(depend on each escape function) ERROR_NOT_SUPPORTED : This function is not supported. Remarks: ═══ 13.6.1.6. ImeInitialize ═══ ImeInitialize This entry is called to initialize the global status of IME just after the IME is loaded to the system at the first time. Format: APIRET APIENTRY ImeInitialize( PIMEINIT pImeInit ) Parameters: pImeInit(input/output) : IME initialization structure as follows. IMEINIT { ULONG ulIMVersion; ULONG ulIMEVersion; ULONG ulIMECaps; ULONG ulConversionCaps; ULONG ulInputCaps; CHAR chClassName[256]; CHAR chWndProcName[256]; } where ulIMVersion(input) : Version of IM Interface. High word of this member contains the major version, and Low word contains the minor version. It is 1.0 in this release. ulIMEVersion(output) : Version of IME Interface. High word of this member contains the major version, and Low word contains the minor version. It is 1.0 in this release. ulIMECaps(output)IME Capability flags which have the combination of the following flags. IME_CAPS_ACCEPTCONVERSIONSTRING : This means that the application can set the conversion string data to IME. IME_CAPS_INHERITCONVERSIONMODE : IME is capable to inherit the conversion mode. IME_CAPS_INHERITINPUTMODE : IME is capable to inherit the input mode. IME_CAPS_PRIVATEUI : This flag means that IME has the special dialog panel other than the normal panels. IME_CAPS_PROVIDEREADINGSTRING : IME is capable to provide the reading string from the conversion string which is set by the application. IME_CAPS_PROVIDEUI : This flag means that IME provides the PM user interface while the instance in PM environment. IME_CAPS_SCREENSWITCHABLE : This flag means that IME allows that the IMInstance can be switchable between the different screen group. For example, Dos box can be fullscreen or window, by a hot-key pressing. If IME sets this flag, the same IMInstance i ed for both environment. If IME does not set this flag, another IMInstance is created at the screen switch. IME_CAPS_UNICODE : The string which is used in any IME I/F is Unicode string. (Not supported in this release). ulConversionCaps(output) : Conversion mode capability flags which shares the bit definition with IMI_CM_* flags in IMMode. ulInputCaps(output) : Input mode capability flags which hares the bit difinition with IMI_IM_* flags in IMMode. chClassName(output) : This is a 256 byte string buffer. If IME is capable to handle PM user interface(i.e. set IME_CAPS_PROVIDEUI), IME must fill the class name of the IME Window class. System will register the IME Window procedure with this class name. This field is ignored if IME_CAPS_PROVIDEUI is not set. chWndProcName(output) : This is a 256 byte string buffer. If IME is capable to handle PM user interface(i.e. set IME_CAPS_PROVIDEUI), IME must fill the IME Window procedure function name. This name is used to get the procedure address of the window proc. This window proc must be explicitly exported in the .DEF file of IME. This field is ignored if IME_CAPS_PROVIDEUI is not set. Returns: Success indicator 0 : Successful completion other : Error occurred Remarks: ═══ 13.6.1.7. ImeNotifyEvent ═══ ImeNotifyEvent This entry is called when the IME related event occurred, e.g., the user inputs the character. IME can call ImRequestEvent in response to the notified event to originate the display requests. Format: APIRET APIENTRY ImeNotifyEvent( HIMI hImi, PNOTIFYEVENT pNotifyEvent ) Parameters: hImi(input) : IMInstance handle pNotifyEvent(input/output) : NotifyEvent structure as follows: NotifyEvent { ULONG ulEventType; ULONG ulInput1; ULONG ulInput2; ULONG ulInput3; ULONG ulOutput; } where ulEventType(input) : Event type, which has one of the following value IME_NE_ATTACHIME : When the IME is attached to hImi, this event is notified to IME. It includes that the case that hImi is newly created. ulInput1 is used as a bool value as TRUE : ATTACHIME, FALSE : DETACHIME. ulInput2, ulInput3 and ulOutput are 0. IME_NE_BROADCASTDATA : This event is generated as the result of calling ImBroadcastData API. ulInput1 contains the type index of passed data, ulInput2 is the pointer to the BROADCASTDATA, ulInput3 and ulOutput are reserved 0. IME_NE_CHANGECANDIDATELIST : This event is generated when the application requested to change the candidate list. ulInput1 contains the index of the candidate list, ulInput2, ulInput3 and ulOutput are reserved 0. IME_NE_CONVERSIONSTRING : The application requests to process the conversion part in the IMInstance. ulInput1 holds one of the following values. IME_NE_CS_CANCEL IME_NE_CS_COMPLETE IME_NE_CS_CONVERT IME_NE_CS_REVERT ulInput2, ulInput3 and ulOutput are reserved 0. IME_NE_FOCUS : The window(or session) which is related to hImi gets/loses the input focus. ulInput1 is used as a bool value as TRUE : gets focus, FALSE : lose focus. ulInput2, ulInput3 and ulOutput are reserved 0. IME_NE_INSTANCEUPDATED : The application or system updated the contents of the IMInstance. ulInput1 contains one of the following values which is corresponding to the IMInstance content. IME_NE_IU_SESSIONTYPE IME_NE_IU_HWND IME_NE_IU_SESSIONID IME_NE_IU_CLIENTINFO IME_NE_IU_CODEPAGE IME_NE_IU_INPUTMODE IME_NE_IU_CONVERSIONMODE IME_NE_IU_STATUSPOS IME_NE_IU_CONVERSIONFONT IME_NE_IU_CONVERSIONPOS IME_NE_IU_CANDIDATEPOS ulInput2 contains the previous instance value when ulInput1 is one of IME_NE_IU_SESSIONTYPE, IME_NE_IU_HWND, IME_NE_IU_SESSIONID, IME_NE_IU_CLIENTINFO, IME_NE_IU_CODEPAGE, IME_NE_IU_INPUTMODE, or IME_NE_IU_CONVERSIONMODE. ulInput3 and ulOutput reserved 0. IME_NE_KEYEVENT : The user presses keyboards. ulInput1 and ulInput2 are identical to the mparam1 and mparam2 of WM_CHAR. Low word of ulInput3 contains the IMEVKEY which is described in IMEVKEY definition. ulOutput is used as a bool value, which specifies that the eyevent is passed to the application(TRUE) or not(FALSE). In PM environment, if ulOutput is FALSE, that key event is not passed to the application. IME_NE_SELECTCANDIDATE : The application selected an item in the candidate window. ulInput1 contains the index of the candidatelist. ulInput2 contains the selected index of the candidate string. ulInput3 and ulOutput are reserved 0. IME_NE_SHOWCANDIDATE : The application requested to show/hide the candidate window. ulInput1 contains the index of the candidate list. ulInput2 is used as a bool value as TRUE : show candidate window, FALSE : hide candidate window. ulInput3 and ulOutput are reserved 0. IME_NE_SETCANDIDATEPAGESIZE : The application requested to set the candidate item counts which are shown within one page. ulInput1 contains the index of the candidate list. ulInput2 contains the new page. ulInput3 and ulOutput are reserved 0. IME_NE_SETTOPCANDIDATE : The application requested to set the requested candidate as a top candidate in that page. ulInput1 contains the index of the candidate list. ulInput2 contains the candidate string index which is set to the top candidate. ulOutput are reserved 0. IME_NE_SHOWSTATUSWINDOW : The application requested to show/hide the status window. ulInput1 is used as a bool value as TRUE : show status window, FALSE : hide status window. ulInput2, ulInput3 and ulOutput are reserved 0. ulInput1(input) : Input parameter 1 of the specified ulEventType. The contents depend on each event type. ulInput2(input) : Input parameter 2 of the specified ulEventType. The contents depend on each event type. ulInput3(input) : Input parameter 3 of the specified ulEventType. The contents depend on each event type. ulOutput(ouput) : Output parameter of the specified ulEventType. The contents depend on each event type. Returns: Success indicator 0 : Successful completion other : Error occurred Remarks: IME needs to call ImRequestEvent with request type which corresponds to the event type. Because IME is attached at each frame window creation, IME should minimize the work at IME_NE_ATTACHIME, otherwise the performance gets significantly worse. If IME eats the key event in reply to IME_NE_KEYEVENT with ulOutput == FALSE, Application will get an internal keyevent message(WM_CHARX1) instead of WM_CHAR. ═══ 13.6.1.8. ImeQueryRegisterWordType ═══ ImeQueryRegisterWordType This entry is called to get the word type information of IME. Format: APIRET APIENTRY ImeQueryRegisterWordType( HIMI hImi, PWORDTYPE paWordType, PULONG pulCount ) Parameters: hImi(input) : IMInstance handle. paWordType(input) : Address of array of WordType structures pulCount(input/output) : On input, max count of types that the paWordType buffer can hold is required. On output, total counts of styles which are copied to paWordType, or if the count is zero on input, total counts of styles which are available is returned. Returns: Success indicator 0 : Successful completion other : Error occurred ERROR_NOT_SUPPORTED : This function is not supported. ═══ 13.6.1.9. ImeRegisterWord ═══ ImeRegisterWord This entry is called to register a new word with its reading to IME. Format: APIRET APIENTRY ImeRegisterWord( HIMI hImi, PSZ pszWord, PSZ pszReading, ULONG ulWordType ) Parameters: hImi(input) : IMInstance handle. pszWord(input) : Word to be registered. pszReading(input) : Reading for pszWord. ulWordType(input) : Word type id. Returns: Success indicator 0 : Successful completion other : Error occurred ERROR_NOT_SUPPORTED : This function is not supported. ═══ 13.6.1.10. ImeSetConversionString ═══ ImeSetConversionString This entry is called to set the current conversion string by the request of the application. Format: APIRET APIENTRY ImeSetConversionString( HIMI hImi, ULONG ulRequestType, PVOID pConversionString, ULONG ulConversionLength, PVOID pvReadingString, ULONG ulReadingLength ) Parameters: hImi(input) : IMInstance handle. ulRequestType(input) : Request type to set. IME_SCS_ATTRIBUTE : Conversion string and reading string field contain the attribute array. IME_SCS_CLAUSEINFO : Conversion string and reading string field contain the clause information array. IME_SCS_STRING : Conversion string and reading string field contain the string. pvConversionString(input) : Conversion string data ulConversionLength(input) : Conversion string length pvReadingString(input) : Reading string data ulReadingLength(input) : Reading string length Returns: Success indicator 0 : Successful completion other : Error occurred ERROR_NOT_SUPPORTED : This function is not supported. ═══ 13.6.1.11. ImeTerminate ═══ ImeTerminate This entry is called to give IME the opportunity to clean up the allocated global resource just before the IME is discarded from the memory. Format: APIRET APIENTRY ImeTerminate( ULONG ulReserved ) Parameters: ulReserved(input) : Reserved. Must be 0. Returns: Success indicator 0 : Successful completion other : Error occurred ═══ 13.6.2. IME Messages ═══ IME Messages IME Messages are the messages which IME gets/sends, related to the user event or application control. WM_IMENOTIFY This message is sent to the application for the notification of the IME related events. IME needs to call ImRequestEvent with the parameter WM_IMENOTIFY/IMN_STARTCONVERSION when IME is about to display its conversion window, and WM_IMENOTIFY/IMN_ENDCONVERSION just after closing conversion window and sending result part string to the application. During the conversion, if no space is available to show the conversion window, IME needs to send WM_IMENOTIFY/IMN_CONVERSIONFULL message from IME's conversion part window procedure using WinSendMsg call. WM_IMEREQUEST This message is sent to the IME Window for the notification of the events. Typically as the result of ImRequestEvent call. Refer to IM Interface section for more detail. WM_QUERYIMEWINDOWCAPS This message is sent to the IME Window by the system to query the capability of Part windows. Parameters: mparam 1 ulIndex(input) : Index to query window capability as follows. IME Window should fill the value corresponding to this index in the area pointed by mparam 2. IWC_CONVERSIONANGLE mparam 2 contains one of the following value which represents the conversion window angle capability. UIC_270 UIC_ANGLE90 UIC_ANGLEANY IWC_CONVERSIONMARGIN mparam2 contains the margin value in pels between the border of the conversion window and actual text box of the conversion text. IWC_FORCEPOSITION mparam2 contains the bool value that indicates that the conversion window supports the CPS_FORCE bit in CONVERSIONPOS structure. mparam 2 pulValue(output) : pointer to the ULONG value corresponding to ulIndex in mparam 1. Returns: Success indicator(BOOL) : TRUE : success. FALSE : failure ═══ 13.6.3. IM Exported Entries for IME ═══ IM Exported Entries for IME IME can call the following entries in addition to the APIs for application. ImBroadcastData ImCreateIMIPart ImDeregisterIME ImDestroyIMIPart ImQueryIMInstanceReqCount ImQueryIMIPartReqCount ImQueryIMIPartSize ImRegisterIME ImReleaseIMInstance ImReleaseIMIPart ImRequestEvent ImRequestIMInstance ImRequestIMIPart ImResizeIMIPart ═══ 13.6.3.1. ImBroadcastData ═══ ImBroadcastData This entry is called when IME wants to broadcast IME defined data to all the IM instances currently being opened. Format: APIRET APIENTRY ImBroadcastData( PSZ pszIMEName, ULONG ulIndex, PVOID pData ) Parameters: pszIMEName(input) : IME Name whose instances are being broadcasted. ulIndex(input) : Data type index IBD_RESERVED_FIRST : First index which the System uses. IBD_RESERVED_LAST : Last index which the System uses. IBD_PRIVATE_FIRST : First index which the IME uses. IBD_PRIVATE_LAST : Last index which the IME uses. pData(input) : IME defined data as following structure. BROADCASTDATAHEADER { ULONG cbSize; BYTE bData[1]; } Returns: Success indicator 0 : Successful completion other : Error occurred ═══ 13.6.3.2. ImCreateIMIPart ═══ ImCreateIMIPart This entry is called to create a IMInstance Part memory area which is accesible through the returned Part handle. Format: APIRET APIENTRY ImCreateIMIPart( ULONG ulPartSize, PHIMIP phimiPart ) Parameters: ulPartSize(input) : Part size to create. phimiPart(output) : Created Part handle Returns: Success indicator 0 : Successful completion other : Error occurred Remarks: The memory area allocated by this function is shared and filled with zero. The maximum allowed buffer length is 32Kbytes. ═══ 13.6.3.3. ImDeregisterIME ═══ ImDeregisterIME IME Install program can deregister IME which was registered with ImRegisterIME. ImDeregisterIME removes the registration from all of the code pages. Format: APIRET APIENTRY ImDeregisterIME( PSZ pszImeName ) Parameters: pszImeName(input) - a name of IME to deregister Returns: Success indicator 0 : Successful completion other : Error occurred Remarks: This API is not called from IME DLL itself, but from IME install program only. ═══ 13.6.3.4. ImDestroyIMIPart ═══ ImDestroyIMIPart This entry is called to destroy a IMInstance Part handle. Format: APIRET APIENTRY ImDestroyIMIPart( HIMIP himiPart ) Parameters: himiPart(input) : Part handle to be destroyed. Returns: Success indicator 0 : Successful completion other : Error occurred ═══ 13.6.3.5. ImQueryIMInstanceReqCount ═══ ImQueryIMInstanceReqCount This entry is called to query access count of the specified IMInstance. Format: APIRET APIENTRY ImQueryIMInstanceReqCount( HIMI hImi, PULONG pulCount ) Parameters: hImi(input) : IMInstance handle pulCount(output) : access count Returns: Success indicator 0 : Successful completion other : Error occurred ═══ 13.6.3.6. ImQueryIMIPartReqCount ═══ ImQueryIMIPartReqCount This entry is called to query request count of the specified IMInstance Part. Format: APIRET APIENTRY ImQueryIMIPartReqCount( HIMIP himiPart, PULONG pulCount ) Parameters: himiPart(input) : Part handle. pulCount(output) : access count Returns: Success indicator 0 : Successful completion other : Error occurred ═══ 13.6.3.7. ImQueryIMIPartSize ═══ ImQueryIMIPartSize This entry is called to query the IMInstance Part data size. Format: APIRET APIENTRY ImQueryIMIPartSize( HIMIP himiPart, PULONG pulPartSize ) Parameters: himiPart(input) : Part handle. pulPartSize(output) : Part data size. Returns: Success indicator 0 : Successful completion other : Error occurred ═══ 13.6.3.8. ImRegisterIME ═══ ImRegisterIME IME Install program can register any IME to any language. Format: APIRET APIENTRY ImRegisterIME( PSZ pszImeName, PREGISTERIMEHEADER pRegIme, PULONG pImeId ) Parameters: pszImeName(input) : a name of IME. This must be the same as actual IME DLL file name without extension(e.g., "FAKEIME"). pRegIme(input) : a pointer to REGISTERIMEHEADER as follows: REGISTERIMEHEADER { ULONG cbSize; ULONG ulLangCount; ULONG offsetLang; ULONG ulDescriptionLen ULONG offsetDescription; ULONG ulFlag; } where cbSize(input) : size of this structure ulLangCount(input) : number of the supported languages. offsetLang(input) : offset of the 2 byte language array ulDescriptionLen(input) : Byte length of the IME Description. offsetDescription(input) : offset of IME Description. IME Description is used for IME Selection panel. ulFlag(input) : Registration flag which is the combination of the following: IM_REG_FLAG_DEFAULT(0x00000001) : The installed IME will be the default IME for all of the languages which this IME supports. IM_REG_FLAG_IME16CALLABLE(0x00000002) : The installed IME has 32-bit IME but also has the 16-bit legacy IME interface. If this flag is set, IMMON and VDMIMFEP will call IME through IME16 interface. It is useful when IME needs to show configure panel in full screen environment. IM_REG_FLAG_IME16(0x80000000) : The installed IME is the 16-bit legacy IME which can be accessible through GTO. pImeId(output) : Registered IME ID is filled on return. Returns: Success indicator 0 : Successful completion other : Error occurred Remarks: This API is not called from IME DLL itself, but from IME install program only. IME DLL file must be placed in some directory which is listed in LIBPATH environment. 'Language' is a 2 byte character such as 'JA'. All available languages are listed in the chapter 'Install'. ═══ 13.6.3.9. ImReleaseIMInstance ═══ ImReleaseIMInstance This entry is called to release access to IMInstance. Format: APIRET APIENTRY ImReleaseIMInstance( HIMI hImi ) Parameters: hImi(input) : IMInstance handle Returns: Success indicator 0 : Successful completion other : Error occurred ═══ 13.6.3.10. ImReleaseIMIPart ═══ ImReleaseIMIPart This entry is called to release access to IMInstance Part. Format: APIRET APIENTRY ImReleaseIMIPart( HIMIP himiPart ) Parameters: himiPart(input) : Part handle. Returns: Success indicator 0 : Successful completion other : Error occurred Remarks: This function decrements the request count of himiPart, which can be queried by ImQueryIMIPartReqCount. ═══ 13.6.3.11. ImRequestEvent ═══ ImRequestEvent This entry is called to request the notification events to be delivered to the application in the case that IME changed some fields of IMInstance. Format: APIRET APIENTRY ImRequestEvent( HIMI hImi, ULONG msg, ULONG mp1, ULONG mp2 ) Parameters: hImi(input) : IMInstance handle msg(input) : Message event type to request. This is one of the following values. WM_IMEREQUEST WM_IMENOTIFY mp1(input) : Message parameter 1 for the message which is specified in 'msg'. mp2(input) : Message parameter 2 for the message which is specified in 'msg'. Returns: Success indicator 0 : Successful completion other : Error occurred Remarks: This API generates WM_IMEREQUEST or WM_IMENOTIFY message in PM environment. ═══ 13.6.3.12. ImRequestIMInstance ═══ ImRequestIMInstance This entry is called to request access to IMInstance. Format: APIRET APIENTRY ImRequestIMInstance( HIMI hImi, PIMINSTANCE * ppIMInstance ) Parameters: hImi(input) : IMInstance handle ppIMInstance(output) : Address of IMInstance Returns: Success indicator 0 : Successful completion other : Error occurred ═══ 13.6.3.13. ImRequestIMIPart ═══ ImRequestIMIPart This entry is called to request access to IMInstance part. Format: APIRET APIENTRY ImRequestIMIPart( HIMIP himiPart, PVOID * ppPartData ) Parameters: himiPart(input) : Part handle ppPartData(output) : Address of Part data structure Returns: Success indicator 0 : Successful completion other : Error occurred Remarks: This function increments the request count of himiPart, which can be queried by ImQueryIMIPartReqCount. ═══ 13.6.3.14. ImResizeIMIPart ═══ ImResizeIMIPart This entry is called to re-size IMInstance Part data size. Format: APIRET APIENTRY ImResizeIMIPart( HIMIP himiPart, ULONG ulNewSize ) Parameters: himiPart(input) : Part handle. ulNewSize(input) : New Part data size. Returns: Success indicator 0 : Successful completion other : Error occurred Remarks: When the resize request is smaller than the original size, the actual data size is not changed with successful return. This function will fail if the request count of himiPart is not zero. ═══ 13.7. IMEVKEY definition ═══ IMEVKEY is a keyboard independent unique 16-bit key value which is assigned to each keytops(nomenclature). The following chart shows the IMEVKEY list for the available keyboards. Basically when the user presses the key, IMEVKEY in Base state is generated. If IMEVKEY at other state is noted, that IMEVKEY is generated not only at that state but also at the state which includes that state, e.g., if IMEVKEY_foo is listed at base state and IMEVKEY_bar is listed at shift state, IMEVKEY_bar is also generated at Shift+Ctrl state, but IMEVKEY_foo is generated at Alt state. ═══ 13.7.1. 5576-A01(106) Keyboard ═══ ┌───┬──────────────────────────────┬──────────────────────────────────────────────────┐ │Key│Base state IMEVKEY │Other State IMEVKEY(if noted) │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │1 │IMEVK_DBE_SBCSCHAR at DBCS │IMEVK_IMEACTIVATE at Alt state │ │ │mode, IMEVK_DBE_DBCSCHAR at │ │ │ │SBCS mode │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │2 │IMEVK_1 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │3 │IMEVK_2 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │4 │IMEVK_3 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │5 │IMEVK_4 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │6 │IMEVK_5 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │7 │IMEVK_6 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │8 │IMEVK_7 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │9 │IMEVK_8 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │10 │IMEVK_9 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │11 │IMEVK_0 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │12 │IMEVK_OEM_MINUS │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │13 │IMEVK_OEM_7 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │14 │IMEVK_OEM_5 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │15 │IMEVK_BACK │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │16 │IMEVK_TAB │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │17 │IMEVK_Q │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │18 │IMEVK_W │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │19 │IMEVK_E │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │20 │IMEVK_R │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │21 │IMEVK_T │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │22 │IMEVK_Y │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │23 │IMEVK_U │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │24 │IMEVK_I │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │25 │IMEVK_O │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │26 │IMEVK_P │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │27 │IMEVK_OEM_3 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │28 │IMEVK_OEM_4 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │30 │IMEVK_DBE_ALPHANUMERIC │IMEVK_CAPITAL at Shift State, IMEVK_DBE_CODEINPUT │ │ │ │at Alt State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │31 │IMEVK_A │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │32 │IMEVK_S │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │33 │IMEVK_D │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │34 │IMEVK_F │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │35 │IMEVK_G │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │36 │IMEVK_H │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │37 │IMEVK_J │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │38 │IMEVK_K │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │39 │IMEVK_L │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │40 │IMEVK_OEM_PLUS │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │41 │IMEVK_OEM_1 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │42 │IMEVK_OEM_6 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │43 │IMEVK_RETURN │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │44 │IMEVK_LEFTSHIFT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │46 │IMEVK_Z │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │47 │IMEVK_X │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │48 │IMEVK_C │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │49 │IMEVK_V │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │50 │IMEVK_B │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │51 │IMEVK_N │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │52 │IMEVK_M │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │53 │IMEVK_OEM_COMMA │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │54 │IMEVK_OEM_PERIOD │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │55 │IMEVK_OEM_2 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │56 │IMEVK_OEM_BSLASH │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │57 │IMEVK_RIGHTSHIFT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │58 │IMEVK_LEFTCONTROL │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │60 │IMEVK_LEFTALT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │61 │IMEVK_SPACE │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │62 │IMEVK_RIGHTALT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │64 │IMEVK_RIGHTCONTROL │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │75 │IMEVK_INSERT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │76 │IMEVK_DELETE │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │79 │IMEVK_LEFT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │80 │IMEVK_HOME │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │81 │IMEVK_END │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │83 │IMEVK_UP │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │84 │IMEVK_DOWN │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │85 │IMEVK_PRIOR │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │86 │IMEVK_NEXT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │89 │IMEVK_RIGHT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │90 │IMEVK_NUMLOCK │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │91 │IMEVK_HOME │IMEVK_NUMPAD7 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │92 │IMEVK_LEFT │IMEVK_NUMPAD4 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │93 │IMEVK_END │IMEVK_NUMPAD1 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │95 │IMEVK_DIVIDE │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │96 │IMEVK_UP │IMEVK_NUMPAD8 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │97 │IMEVK_CLEAR │IMEVK_NUMPAD5 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │98 │IMEVK_DOWN │IMEVK_NUMPAD2 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │99 │IMEVK_INSERT │IMEVK_NUMPAD0 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │100│IMEVK_MULTIPLY │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │101│IMEVK_PRIOR │IMEVK_NUMPAD9 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │102│IMEVK_RIGHT │IMEVK_NUMPAD6 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │103│IMEVK_NEXT │IMEVK_NUMPAD3 at NumLock State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │104│IMEVK_DECIMAL │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │105│IMEVK_SUBTRACT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │106│IMEVK_ADD │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │108│IMEVK_RETURN │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │110│IMEVK_ESCAPE │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │112│IMEVK_F1 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │113│IMEVK_F2 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │114│IMEVK_F3 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │115│IMEVK_F4 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │116│IMEVK_F5 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │117│IMEVK_F6 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │118│IMEVK_F7 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │119│IMEVK_F8 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │120│IMEVK_F9 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │121│IMEVK_F10 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │122│IMEVK_F11 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │123│IMEVK_F12 │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │124│IMEVK_SNAPSHOT │IMEVK_SYSREQ at Alt State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │125│IMEVK_SCROLL │IMEVK_CANCEL at Ctrl State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │126│IMEVK_CANCEL │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │131│IMEVK_NONCONVERT │ │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │132│IMEVK_CONVERT │IMEVK_PREVCANDIDATE at Shift State, │ │ │ │IMEVK_ALLCANDIDATE at Alt State │ ├───┼──────────────────────────────┼──────────────────────────────────────────────────┤ │133│IMEVK_DBE_HIRAGANA │IMEVK_DBE_KATAKANA at Shift State, IMEVK_DBE_ROMAN│ │ │ │at Alt State │ └───┴──────────────────────────────┴──────────────────────────────────────────────────┘ ═══ 13.7.2. US(101) Keyboard ═══ ┌───┬─────────────────────────┬──────────────────────────────────────────────────┐ │Key│Base state IMEVKEY │Other State IMEVKEY(if noted) │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │1 │IMEVK_OEM_3 │IMEVK_DBE_SBCSCHAR at Ctrl state and DBCS mode, │ │ │ │IMEVK_DBE_DBCSCHAR at Ctrl state and SBCS mode, │ │ │ │IMEVK_IMEACTIVATE at Alt state │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │2 │IMEVK_1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │3 │IMEVK_2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │4 │IMEVK_3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │5 │IMEVK_4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │6 │IMEVK_5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │7 │IMEVK_6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │8 │IMEVK_7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │9 │IMEVK_8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │10 │IMEVK_9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │11 │IMEVK_0 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │12 │IMEVK_OEM_MINUS │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │13 │IMEVK_OEM_PLUS │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │15 │IMEVK_BACK │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │16 │IMEVK_TAB │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │17 │IMEVK_Q │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │18 │IMEVK_W │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │19 │IMEVK_E │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │20 │IMEVK_R │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │21 │IMEVK_T │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │22 │IMEVK_Y │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │23 │IMEVK_U │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │24 │IMEVK_I │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │25 │IMEVK_O │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │26 │IMEVK_P │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │27 │IMEVK_OEM_4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │28 │IMEVK_OEM_6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │29 │IMEVK_OEM_5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │30 │IMEVK_CAPITAL │IMEVK_DBE_ALPHANUMERIC at Shift State, │ │ │ │IMEVK_DBE_HIRAGANA at Ctrl State, │ │ │ │IMEVK_DBE_KATAKANA at Alt State, │ │ │ │IMEVK_DBE_CODEINPUT at Shift+Alt State, │ │ │ │IMEVK_DBE_ROMAN at Ctrl+Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │31 │IMEVK_A │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │32 │IMEVK_S │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │33 │IMEVK_D │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │34 │IMEVK_F │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │35 │IMEVK_G │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │36 │IMEVK_H │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │37 │IMEVK_J │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │38 │IMEVK_K │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │39 │IMEVK_L │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │40 │IMEVK_OEM_1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │41 │IMEVK_OEM_7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │43 │IMEVK_RETURN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │44 │IMEVK_LEFTSHIFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │46 │IMEVK_Z │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │47 │IMEVK_X │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │48 │IMEVK_C │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │49 │IMEVK_V │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │50 │IMEVK_B │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │51 │IMEVK_N │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │52 │IMEVK_M │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │53 │IMEVK_OEM_COMMA │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │54 │IMEVK_OEM_PERIOD │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │55 │IMEVK_OEM_2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │57 │IMEVK_RIGHTSHIFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │58 │IMEVK_LEFTCONTROL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │60 │IMEVK_LEFTALT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │61 │IMEVK_SPACE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │62 │IMEVK_RIGHTALT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │64 │IMEVK_RIGHTCONTROL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │75 │IMEVK_INSERT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │76 │IMEVK_DELETE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │79 │IMEVK_LEFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │80 │IMEVK_HOME │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │81 │IMEVK_END │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │83 │IMEVK_UP │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │84 │IMEVK_DOWN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │85 │IMEVK_PRIOR │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │86 │IMEVK_NEXT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │89 │IMEVK_RIGHT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │90 │IMEVK_NUMLOCK │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │91 │IMEVK_HOME │IMEVK_NUMPAD7 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │92 │IMEVK_LEFT │IMEVK_NUMPAD4 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │93 │IMEVK_END │IMEVK_NUMPAD1 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │95 │IMEVK_DIVIDE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │96 │IMEVK_UP │IMEVK_NUMPAD8 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │97 │IMEVK_CLEAR │IMEVK_NUMPAD5 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │98 │IMEVK_DOWN │IMEVK_NUMPAD2 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │99 │IMEVK_INSERT │IMEVK_NUMPAD0 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │100│IMEVK_MULTIPLY │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │101│IMEVK_PRIOR │IMEVK_NUMPAD9 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │102│IMEVK_RIGHT │IMEVK_NUMPAD6 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │103│IMEVK_NEXT │IMEVK_NUMPAD3 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │104│IMEVK_DECIMAL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │105│IMEVK_SUBTRACT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │106│IMEVK_ADD │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │108│IMEVK_RETURN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │110│IMEVK_ESCAPE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │112│IMEVK_F1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │113│IMEVK_F2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │114│IMEVK_F3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │115│IMEVK_F4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │116│IMEVK_F5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │117│IMEVK_F6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │118│IMEVK_F7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │119│IMEVK_F8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │120│IMEVK_F9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │121│IMEVK_F10 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │122│IMEVK_F11 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │123│IMEVK_F12 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │124│IMEVK_SNAPSHOT │IMEVK_SYSREQ at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │125│IMEVK_SCROLL │IMEVK_CANCEL at Ctrl State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │126│IMEVK_CANCEL │ │ └───┴─────────────────────────┴──────────────────────────────────────────────────┘ Note: Conversion and No -Conversion IMEVKEYs are not generated even when the user presses the right or left shift key alone. Note: IMEVKEY definition of CapsLock key(IMEVK_CAPITAL and IMEVK_DBE_ALPHANUMERIC) is different from Win95's. ═══ 13.7.3. 5576-001 Keyboard ═══ ┌───┬─────────────────────────┬──────────────────────────────────────────────────┐ │Key│Base state IMEVKEY │Other State IMEVKEY(if noted) │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │1 │IMEVK_ESCAPE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │2 │IMEVK_1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │3 │IMEVK_2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │4 │IMEVK_3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │5 │IMEVK_4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │6 │IMEVK_5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │7 │IMEVK_6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │8 │IMEVK_7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │9 │IMEVK_8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │10 │IMEVK_9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │11 │IMEVK_0 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │12 │IMEVK_OEM_MINUS │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │13 │IMEVK_OEM_7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │14 │IMEVK_OEM_5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │15 │IMEVK_BACK │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │16 │IMEVK_TAB │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │17 │IMEVK_Q │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │18 │IMEVK_W │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │19 │IMEVK_E │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │20 │IMEVK_R │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │21 │IMEVK_T │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │22 │IMEVK_Y │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │23 │IMEVK_U │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │24 │IMEVK_I │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │25 │IMEVK_O │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │26 │IMEVK_P │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │27 │IMEVK_OEM_3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │28 │IMEVK_OEM_4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │29 │IMEVK_RETURN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │30 │IMEVK_DBE_KATAKANA │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │31 │IMEVK_A │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │32 │IMEVK_S │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │33 │IMEVK_D │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │34 │IMEVK_F │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │35 │IMEVK_G │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │36 │IMEVK_H │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │37 │IMEVK_J │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │38 │IMEVK_K │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │39 │IMEVK_L │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │40 │IMEVK_OEM_PLUS │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │41 │IMEVK_OEM_1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │42 │IMEVK_OEM_6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │44 │IMEVK_LEFTSHIFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │46 │IMEVK_Z │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │47 │IMEVK_X │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │48 │IMEVK_C │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │49 │IMEVK_V │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │50 │IMEVK_B │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │51 │IMEVK_N │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │52 │IMEVK_M │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │53 │IMEVK_OEM_COMMA │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │54 │IMEVK_OEM_PERIOD │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │55 │IMEVK_OEM_2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │56 │IMEVK_OEM_BSLASH │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │57 │IMEVK_RIGHTSHIFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │58 │IMEVK_LEFTALT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │59 │IMEVK_DBE_ALPHANUMERIC │IMEVK_CAPITAL at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │60 │IMEVK_NONCONVERT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │61 │IMEVK_SPACE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │62 │IMEVK_CONVERT │IMEVK_PREVCANDIDATE at Shift State, │ │ │ │IMEVK_ALLCANDIDATE at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │63 │IMEVK_DBE_HIRAGANA │IMEVK_DBE_ROMAN at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │64 │IMEVK_RIGHTCONTROL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │65 │IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │66 │IMEVK_CANCEL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │67 │IMEVK_DBE_SBCSCHAR │IMEVK_DBE_DBCSCHAR at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │68 │IMEVK_IMEACTIVATE │IMEVK_DBE_CODEINPUT at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │69 │IMEVK_LEFTCONTROL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │70 │IMEVK_CLEAR │IMEVK_SYSREQ on Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │71 │IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │72 │IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │73 │IMEVK_DBE_WORDREGISTER │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │74 │IMEVK_CANCEL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │75 │IMEVK_PRIOR │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │76 │IMEVK_INSERT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │78 │IMEVK_LEFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │80 │IMEVK_END │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │81 │IMEVK_DELETE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │82 │IMEVK_UP │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │83 │IMEVK_HOME │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │84 │IMEVK_DOWN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │85 │IMEVK_NEXT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │86 │IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │88 │IMEVK_RIGHT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │90 │IMEVK_MULTIPLY │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │91 │IMEVK_NUMPAD7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │92 │IMEVK_NUMPAD4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │93 │IMEVK_NUMPAD1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │95 │IMEVK_DIVIDE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │96 │IMEVK_NUMPAD8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │97 │IMEVK_NUMPAD5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │98 │IMEVK_NUMPAD2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │99 │IMEVK_NUMPAD0 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │100│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │101│IMEVK_NUMPAD9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │102│IMEVK_NUMPAD6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │103│IMEVK_NUMPAD3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │104│IMEVK_DECIMAL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │105│IMEVK_SUBTRACT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │106│IMEVK_ADD │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │107│IMEVK_RETURN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │110│IMEVK_F1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │111│IMEVK_F2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │112│IMEVK_F3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │113│IMEVK_F4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │114│IMEVK_F5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │115│IMEVK_F6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │116│IMEVK_F7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │117│IMEVK_F8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │118│IMEVK_F9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │119│IMEVK_F10 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │120│IMEVK_F11 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │121│IMEVK_F12 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │122│IMEVK_SNAPSHOT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │123│IMEVK_SCROLL │IMEVK_CANCEL at Ctrl State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │124│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │125│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │126│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │127│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │128│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │129│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │130│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │131│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │132│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │133│IMEVK_UNDEF │ │ └───┴─────────────────────────┴──────────────────────────────────────────────────┘ ═══ 13.7.4. 5576-002,5576-003 Keyboard ═══ Key numbers for each keytop are the same as 106 keyboard. ┌───┬─────────────────────────┬──────────────────────────────────────────────────┐ │Key│Base state IMEVKEY │Other State IMEVKEY(if noted) │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │1 │IMEVK_DBE_SBCSCHAR │at DBCS mode, IMEVK_DBE_DBCSCHAR at SBCS mode │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │2 │IMEVK_1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │3 │IMEVK_2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │4 │IMEVK_3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │5 │IMEVK_4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │6 │IMEVK_5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │7 │IMEVK_6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │8 │IMEVK_7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │9 │IMEVK_8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │10 │IMEVK_9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │11 │IMEVK_0 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │12 │IMEVK_OEM_MINUS │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │13 │IMEVK_OEM_7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │14 │IMEVK_OEM_5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │15 │IMEVK_BACK │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │16 │IMEVK_TAB │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │17 │IMEVK_Q │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │18 │IMEVK_W │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │19 │IMEVK_E │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │20 │IMEVK_R │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │21 │IMEVK_T │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │22 │IMEVK_Y │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │23 │IMEVK_U │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │24 │IMEVK_I │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │25 │IMEVK_O │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │26 │IMEVK_P │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │27 │IMEVK_OEM_3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │28 │IMEVK_OEM_4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │30 │IMEVK_DBE_ALPHANUMERIC │IMEVK_CAPITAL at Shift State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │31 │IMEVK_A │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │32 │IMEVK_S │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │33 │IMEVK_D │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │34 │IMEVK_F │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │35 │IMEVK_G │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │36 │IMEVK_H │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │37 │IMEVK_J │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │38 │IMEVK_K │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │39 │IMEVK_L │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │40 │IMEVK_OEM_PLUS │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │41 │IMEVK_OEM_1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │42 │IMEVK_OEM_6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │43 │IMEVK_RETURN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │44 │IMEVK_LEFTSHIFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │46 │IMEVK_Z │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │47 │IMEVK_X │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │48 │IMEVK_C │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │49 │IMEVK_V │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │50 │IMEVK_B │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │51 │IMEVK_N │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │52 │IMEVK_M │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │53 │IMEVK_OEM_COMMA │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │54 │IMEVK_OEM_PERIOD │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │55 │IMEVK_OEM_2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │56 │IMEVK_OEM_BSLASH │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │57 │IMEVK_RIGHTSHIFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │58 │IMEVK_LEFTCONTROL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │60 │IMEVK_DBE_KATAKANA │IMEVK_IMEACTIVATE at Shift State, │ │ │ │IMEVK_DBE_CODEINPUT at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │61 │IMEVK_SPACE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │62 │IMEVK_LEFTALT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │64 │IMEVK_RIGHTCONTROL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │75 │IMEVK_INSERT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │76 │IMEVK_DELETE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │79 │IMEVK_LEFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │80 │IMEVK_HOME │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │81 │IMEVK_END │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │83 │IMEVK_UP │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │84 │IMEVK_DOWN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │85 │IMEVK_PRIOR │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │86 │IMEVK_NEXT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │89 │IMEVK_RIGHT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │90 │IMEVK_MULTIPLY │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │91 │IMEVK_NUMPAD7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │92 │IMEVK_NUMPAD4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │93 │IMEVK_NUMPAD1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │95 │IMEVK_DIVIDE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │96 │IMEVK_NUMPAD8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │97 │IMEVK_NUMPAD5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │98 │IMEVK_NUMPAD2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │99 │IMEVK_NUMPAD0 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │100│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │101│IMEVK_NUMPAD9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │102│IMEVK_NUMPAD6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │103│IMEVK_NUMPAD3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │104│IMEVK_DECIMAL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │105│IMEVK_SUBTRACT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │106│IMEVK_ADD │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │108│IMEVK_RETURN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │110│IMEVK_ESCAPE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │112│IMEVK_F1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │113│IMEVK_F2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │114│IMEVK_F3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │115│IMEVK_F4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │116│IMEVK_F5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │117│IMEVK_F6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │118│IMEVK_F7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │119│IMEVK_F8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │120│IMEVK_F9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │121│IMEVK_F10 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │122│IMEVK_F11 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │123│IMEVK_F12 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │124│IMEVK_SNAPSHOT │IMEVK_SYSREQ at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │125│IMEVK_SCROLL │IMEVK_NUMLOCK at Shift State IMEVK_CANCEL at Ctrl │ │ │ │State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │126│IMEVK_CANCEL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │131│IMEVK_NONCONVERT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │132│IMEVK_CONVERT │IMEVK_PREVCANDIDATE at Shift State, │ │ │ │IMEVK_ALLCANDIDATE at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │133│IMEVK_DBE_HIRAGANA │IMEVK_DBE_ROMAN at Alt State │ └───┴─────────────────────────┴──────────────────────────────────────────────────┘ ═══ 13.7.5. AX Keyboard ═══ ┌───┬─────────────────────────┬──────────────────────────────────────────────────┐ │Key│Base state IMEVKEY │Other State IMEVKEY(if noted) │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │1 │IMEVK_ESCAPE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │2 │IMEVK_1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │3 │IMEVK_2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │4 │IMEVK_3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │5 │IMEVK_4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │6 │IMEVK_5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │7 │IMEVK_6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │8 │IMEVK_7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │9 │IMEVK_8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │10 │IMEVK_9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │11 │IMEVK_0 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │12 │IMEVK_OEM_MINUS │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │13 │IMEVK_OEM_PLUS │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │14 │IMEVK_OEM_5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │15 │IMEVK_BACK │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │16 │IMEVK_TAB │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │17 │IMEVK_Q │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │18 │IMEVK_W │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │19 │IMEVK_E │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │20 │IMEVK_R │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │21 │IMEVK_T │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │22 │IMEVK_Y │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │23 │IMEVK_U │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │24 │IMEVK_I │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │25 │IMEVK_O │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │26 │IMEVK_P │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │27 │IMEVK_OEM_4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │28 │IMEVK_OEM_6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │30 │IMEVK_LEFTCONTROL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │31 │IMEVK_A │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │32 │IMEVK_S │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │33 │IMEVK_D │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │34 │IMEVK_F │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │35 │IMEVK_G │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │36 │IMEVK_H │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │37 │IMEVK_J │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │38 │IMEVK_K │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │39 │IMEVK_L │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │40 │IMEVK_OEM_1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │41 │IMEVK_OEM_3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │42 │IMEVK_OEM_7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │43 │IMEVK_RETURN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │44 │IMEVK_LEFTSHIFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │46 │IMEVK_Z │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │47 │IMEVK_X │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │48 │IMEVK_C │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │49 │IMEVK_V │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │50 │IMEVK_B │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │51 │IMEVK_N │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │52 │IMEVK_M │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │53 │IMEVK_OEM_COMMA │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │54 │IMEVK_OEM_PERIOD │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │55 │IMEVK_OEM_2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │56 │IMEVK_OEM_BSLASH │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │57 │IMEVK_RIGHTSHIFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │58 │IMEVK_CAPITAL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │60 │IMEVK_LEFTALT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │61 │IMEVK_SPACE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │62 │IMEVK_IMEACTIVATE │IMEVK_DBE_SBCSCHAR at Shift State and DBCS mode, │ │ │ │IMEVK_DBE_DBCSCHAR at Shift State and SBCS mode, │ │ │ │IMEVK_DBE_CODEINPUT at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │64 │IMEVK_DBE_ALPHANUMERIC at│IMEVK_DBE_HIRAGANA at Shift State, IMEVK_DBE_ROMAN│ │ │Hira or Kata mode, │at Ctrl State │ │ │IMEVK_DBE_KATAKANA at │ │ │ │Alph or Hira mode │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │70 │IMEVK_NONCONVERT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │71 │IMEVK_CONVERT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │75 │IMEVK_INSERT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │76 │IMEVK_DELETE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │79 │IMEVK_LEFT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │80 │IMEVK_HOME │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │81 │IMEVK_END │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │83 │IMEVK_UP │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │84 │IMEVK_DOWN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │85 │IMEVK_PRIOR │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │86 │IMEVK_NEXT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │89 │IMEVK_RIGHT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │90 │IMEVK_NUMLOCK │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │91 │IMEVK_HOME │IMEVK_NUMPAD7 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │92 │IMEVK_LEFT │IMEVK_NUMPAD4 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │93 │IMEVK_END │IMEVK_NUMPAD1 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │95 │IMEVK_DIVIDE │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │96 │IMEVK_UP │IMEVK_NUMPAD8 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │97 │IMEVK_CLEAR │IMEVK_NUMPAD5 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │98 │IMEVK_DOWN │IMEVK_NUMPAD2 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │99 │IMEVK_INSERT │IMEVK_NUMPAD0 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │100│IMEVK_MULTIPLY │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │101│IMEVK_PRIOR │IMEVK_NUMPAD9 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │102│IMEVK_RIGHT │IMEVK_NUMPAD6 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │103│IMEVK_NEXT │IMEVK_NUMPAD3 at NumLock State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │104│IMEVK_DECIMAL │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │105│IMEVK_SUBTRACT │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │106│IMEVK_ADD │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │108│IMEVK_RETURN │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │110│IMEVK_UNDEF │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │112│IMEVK_F1 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │113│IMEVK_F2 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │114│IMEVK_F3 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │115│IMEVK_F4 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │116│IMEVK_F5 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │117│IMEVK_F6 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │118│IMEVK_F7 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │119│IMEVK_F8 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │120│IMEVK_F9 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │121│IMEVK_F10 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │122│IMEVK_F11 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │123│IMEVK_F12 │ │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │124│IMEVK_SNAPSHOT │IMEVK_SYSREQ at Alt State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │125│IMEVK_SCROLL │IMEVK_CANCEL at Ctrl State │ ├───┼─────────────────────────┼──────────────────────────────────────────────────┤ │126│IMEVK_CANCEL │ │ └───┴─────────────────────────┴──────────────────────────────────────────────────┘ ═══ 13.8. Default Window Classes ═══ ═══ 13.8.1. IME Window Class ═══ This class's window procedure is WinDefImeWindowProc itself, which handles the following messages. WM_IMEREQUEST Default IME Window just sends this message to the appropriate default part window. If the default part window does not exist, creates that window before sending the message. WM_QUERYIMEWINDOWCAPS Default IME Window procedure sends this message to the default conversion part window to query the capability of conversion window. WM_DESTROY The default IME Window destroys the default part windows which are created by the default IME Window. ═══ 13.8.2. Conversion Part Class ═══ The instance of the default Conversion Part Class is an object window which creates a set of ConversionText windows(actually visible windows). The default conversion class supports only horizontal(Left-to-Right) and vertical(Top-to-Bottom) writing, i.e. c apability is UIC_270 in this release. The owner window of the conversion text windows is the application window specified in IMInstance. The appearance of the conversion text window differs along with the style of the conversion window as follows: CPS_DEFAULT: Conversion text window is displayed with thick border. It can be dragged by mouse(usually, right button) Does not wrap even when the text string exceeds the screen. Default position of the CPS_DEFAULT style is BottomLeft of the screen in ho izontal writing and TopLeft of the screen in vertical writing. CPS_POINT: Conversion text window is displayed with thin border at the position specified by cpConversionPos and cannot be dragged. Conversion text window in this style wraps within the rect of the window which is specified in IMInstance. CPS_FORCE: Same effect as CPS_POINT. CPS_RECT: Conversion text window is displayed with thin border at the position specified by cpConversionPos and cannot be dragged. Conversion text window in this style wraps within the rect specified in IMInstance. When no space for displaying the conversion text window is available, WM_IMENOTIFY(IMN_CONVERSIONFULL) message is posted to the application window. The default color of the conversion text window is described below: ┌──────────────────────────────┬──────────┬──────────┐ │ │Fore Color│Back Color│ ├──────────────────────────────┼──────────┼──────────┤ │CP_ATTR_INPUT │White │Black │ ├──────────────────────────────┼──────────┼──────────┤ │CP_ATTR_TARGET_CONVERTED │White │Black │ ├──────────────────────────────┼──────────┼──────────┤ │CP_ATTR_CONVERTED │Black │White │ ├──────────────────────────────┼──────────┼──────────┤ │CP_ATTR_TARGET_NOTCONVERTED │Black │White │ ├──────────────────────────────┼──────────┼──────────┤ │CP_ATTR_INPUT_ERROR │White │Red │ └──────────────────────────────┴──────────┴──────────┘ IME can change this color by sending WM_SETWINDOWPARAMS message described below. WM_IMEREQUEST IMR_CONVRESULT When the default conversion window received this message, its conversion text windows are redrawn using ConversionString, ConversionAttribute, ConversionPos, ConversionFont and ConversionAngle which are specified in IMInstance. IMR_OTHERINFO_HWND The owner window of the conversion text windows are changed. WM_QUERYIMEWINDOWCAPS Returns the following value in mparam 2 according to the index in mparam 1. IWC_CONVERSIONANGLE : UIC_270 in this release. IWC_CONVERSIONMARGIN : 2 in this release. IWC_FORCEPOSITION : FALSE in this release. WM_QUERY/SETWINDOWPARAMS The following control data is defined for the default conversion part class to set/query the color for the specified string attributes. typedef struct _CONVCLR { /* convclr */ ULONG ulAttr; COLOR cFore; COLOR cBack; } CONVCLR; typedef struct _CONVERSIONDATA { /* conversiondata */ USHORT usSize; ULONG ulCount; CONVCLR aConvClr[1]; } CONVERSIONDATA; where ulAttr : Field attribute(CP_ATTR_*) cFore : Foreground color for ulAttr cBack : Background color for ulAttr usSize : Size of this structure ulCount: Count of ConvClr structures held in this structure aConvClr: Array of ConvClr structures ═══ 13.8.3. Status Part Class ═══ The instance of the default Status Part Class is an object window which sends IME related messages to the global shift status window and the global mode status window, which are shared by all IM instances in the system. Those windows are owned by the firs t IME Window which needs the default status windows. Shift status window consists of some buttons which are related to the state of the ulInputMode member of IMInstance. Mode status window is a simple text window with some attributes. Usually this window is used to display the IME Modes(e.g. 'Kanji' string in Japanese). Shift status window and Mode status window are created with WS_DISABLED style, because these window does not need focus and not needed to be switched to. And they also respond to WM_HITTES T message with the return code of HT_NORMAL to handle mouse events. Following is a snap of the Shift status window and Mode status window for Japan. If the user clicks mouse right button on either of Shift status or Mode status window, a popup menu appears as above. Top menu item is for IME Set-up dialog which actually calls ImShowIMEDlg(IME_DLG_CONFIG). Next menu item is for RegisterWord which actual ly calls ImShowIMEDlg(IME_DLG_REGWORD). Bottom menu item is for setting fonts which is used in both of Shift status and Mode status windows. The default position of the status windows are bottom-right of the screen. The shift status window can have 8 buttons as maximum, which can be defined in its resource file. WM_IMEREQUEST IMR_INSTANCEACTIVATE Shows the Shift status window with appropriate input mode display. Mode status window is shown if the control data is specified by WM_SETWINDOWPARAMS. IMR_STATUS Changes the appearance according to the modification of the status part in IMInstance. When the input mode is changed, Shift status window and Mode status window are brought to top in Z-Order. ═══ 13.8.4. Candidate Part Class ═══ The instance of the default Candidate Part Class is an object window which creates of Candidate List window(actually visible window) as follows. This candidate list window can be dragged by mouse drag button( usually right mouse button). WM_IMEREQUEST IMR_CANDIDATE_SHOW Candidate window shows the candidate list window according to the information in IMInstance. Usually, the top-left corner of the candidate window is placed at the position which is specified in IMInstance, but if the candidate list window exceeds the desk top window boundary, it is adjusted. If the title string length is 0 in CandidateList structure, the default title string which is appropriate for the candidate style(CLS_*) is displayed. IMR_CANDIDATE_HIDE Candidate List window is hidden when the candidate window receives this message. IMR_CANDIDATE_CHANGE Candidate List window is redrawn with the new contents in IMInstance. IMR_CANDIDATE_CANDIDATEPOS If the candidate list index is unchanged, Candidate list window is just re-positioned, else the same effect with IMR_CANDIDATE_CHANGE takes place. IMR_CANDIDATE_SELECT Candidate list window hilites the newly selected candidate and stops hilite state of currently selected candidate. IMR_OTHERINFO_HWND The owner window of the candidate list window is changed. WM_QUERY/SETWINDOWPARAMS Defatul candidate class supports the following control data for WM_QUERY/SETWINDOWPARAMS when WPM_CTLDATA is specified. typedef struct _CANDCTLDATA { /* candctldata */ USHORT usSize; ULONG ulCtlFlag; PFNMOUNOTIFY pfnMouseNotify; } CANDCTLDATA; where usSize : Size of CANDCTLDATA structure. ulCtlFlag : flag which shows the data to query/set. Currently only CCD_MOUSENOTIFYENTRY is available. pfnMouseNotify : Entry point address of Mouse event notification. If this parameter is set to 0, mouse event notification is canceled. The mouse notification entry must conform to the following prototype. VOID EXPENTRY MouseNotify( HIMI himi, ULONG ulMsg, ULONG ulCandIndex ) where himi : himi whose candidate list get the mouse event ulMsg : same as PM's mouse msg which is one of the following: WM_MOUSEMOVE WM_BUTTON1DOWN WM_BUTTON1UP WM_BUTTON1DBLCLK WM_BUTTON2DOWN WM_BUTTON2UP WM_BUTTON2DBLCLK WM_BUTTON3DOWN WM_BUTTON3UP WM_BUTTON3DBLCLK WM_MOUSEMAP WM_CHORD WM_BUTTON1MOTIONSTART WM_BUTTON1MOTIONEND WM_BUTTON1CLICK WM_BUTTON2MOTIONSTART WM_BUTTON2MOTIONEND WM_BUTTON2CLICK WM_BUTTON3MOTIONSTART WM_BUTTON3MOTIONEND WM_BUTTON3CLICK ulCandIndex : Candidate item index where the mouse event happened. The following 2 special value index are passed when the message is WM_MOUSEMOVE and the mouse pointer is outside the candidate list box. CI_PREVPAGE(0xfffffffe) : When the mouse pointer is placed above the top item in the list which is currently visible. CI_NEXTPAGE(0xffffffff) : When the mouse pointer is placed below the bottom item in the list which is currently visible. ═══ 13.8.5. Information Message Part Class ═══ The default Information Message Part window is an object window to communicatie with an IME window. The default Information Part window creates a MessageBox panel when it receives a request to display a message. WM_CREATE The default Information Message Part window sets the its window handle to the window data of the owner window by using WinSetWindowULong with QWL_IMEW_HWNDINFOMSG. WM_IMEREQUEST IMR_INFOMSG (IMR_INFOMSG_ERRLEVEL) The default Information Message Part window displays a pre-defined Error Level string as the title of the Message Box, corresponding to each IM_ERRLEVEL_xxx value. The meanings and pre-defined strings for each IM_ERRLEVEL_xxx are as follows: IM_ERRLEVEL_NONE: There is no specific title. The string is "Message". IM_ERRLEVEL_INFORMATION: There is information to a user. The string is "Information". The Message Box contains a black information "i" in a square box. IM_ERRLEVEL_WARNING: Unexpected event occurs. IME warns a user the event and it would continue to process. The string is "Warning" (or "Caution"). The Message box contains a black "!" in a square box. IM_ERRLEVEL_ERROR: Some error occurs. The process may terminate. The string is "Error". The Message Box contains a STOP sign on a white background. IM_ERRLEVEL_FATAL: Fatal error occurs. Some data may be lost and the process might abort. The string is "Unrecoverable Error" (or "Fatal Error"). The Message Box contains a STOP sign on a white background. IM_ERRLEVEL_HELP: There is a help information to a user. The string is "Help". Note: These strings will be translated in each national language. IMR_INFOMSG (IMR_INFOMSG_ERRINDEX) The default Information Message Part window displays a pre-defined Error Information string as the message within the Message Box, corresponding to each IM_INFOID_xxx value. If IMR_INFOMSG_ERRSTR is also valid, the default window concatenates the pre-defined string with a specified string, and then display it in the Message Box. (The pre-defined string is placed in front of the specified string.) The meanings and pre-defined strings for each IM_INFOID_xxx are as follows: IM_INFOID_UNSAVABLE: IME can't save a dictionary or a profile data. The string is "Can't save a dictionary or a setting data". IM_INFOID_NOCONVERT: IME can't convert any further. The string is "No more conversion candidate". IM_INFOID_NODICTIONARY: IME can't find or recognize a dictionary. The string is "Can't find a dictionary". IM_INFOID_NOMODULE: IME can't find a module. The string is "Can't find a required module". IM_INFOID_INVALIDREADING: Some error occurs in Reading, e.g. some vowels can't be put continuously. The string is "Invalid Reading Input". IM_INFOID_TOOMANYSTROKES: There are too many strokes for one character or one clause. The string is "Too many Input Characters". IM_INFOID_TYPINGERROR: Typing error occurs. IME can't handle it. The string is "Error in Typing". IM_INFOID_UNDEFINED: Undefined error occurs. Applications need to refer an additional error message. The string is "Unexpected Error". IM_INFOID_INPUTREADING: IME prompts a user to input Reading characters. The string is "Please input Reading Characters". IM_INFOID_INPUTRADICAL: IME prompts a user to input Radicals. The string is "Please input Radicals". IM_INFOID_INPUTCODE: IME prompts a user to input character codes. The string is "Please input Character Codes". IM_INFOID_SELECTCANDIDATE: IME prompts a user to select a candidate. The string is "Please select a candidate". IM_INFOID_REVERSECONVERSION: IME prompts a user to input information for a reverse conversion. The string is "Please input information for a Reverse Conversion". Note: These strings will be translated in each national language. IMR_INFOMSG (IMR_INFOMSG_ERRSTR) When the default Information Message Part window receives the WM_IMEREQUEST (IMR_INFOMSG, IMR_INFOMSG_ERRSTR) message, it shows the specified message string with WinMessageBox API. IMR_INFOMSG (IMR_INFOMSG_PRIVATE) The default Information Message Part window doesn't handle the WM_IMEREQUEST message with "IMR_INFOMSG, IMR_INFOMSG_PRIVATE". This message may or may not be handled by applications. ═══ 13.8.6. Register Word Part Class ═══ The default register word part window is the object window to communicate with the IME window. The default register word part window creates the register word dialog when the default register word part window receives the request of displaying the dialog panel. The design of the register word dialog is following: When the register word dialog is shown, the word (GOKU) field and the reading (YOMI) field are initialiezed by the register word part data and the word type (HINSHI) list box is filled with the register word types gotten by ImQueryRegisterWordType API. If the register word type information can not be gotten, the word type (HINSHI) list box is disable and hiden. When an user presses the register (TOUROKU) button, the register word dialog issues ImRegisterWord. When an user presses the exit (SYURYOU) button, the register word disalog is hiden itself without calling ImRegisterWord. At this release, the maximum lenght of the word field is 40 bytes. The maximum lenght of the reading field is 20 bytes. WM_CREATE The default register word part window sets the its window handle to the window data of the owner window by using WinSetWindowULong with QWL_IMEW_HWNDREGWORD. WM_DESTROY If the defualt register word part window creates the register word dialog, the default register word part window destroys the register word diallog . WM_IMEREQUEST IMR_REGWORD( IMR_REQWORD_SHOW) When the default register word part window receives the first WM_IMEREQUEST (IMR_REQWORD, IMR_REGWORD_SHOW) message, the default register word part window loads the register word dialog and shows the loaded register word dialog. When the default register word part window receives the next WM_IMEREQUEST (IMR_REGWORD, IMR_REGWORD_SHOW) message, the default register word part window show the register word dialog. IMR_REGWORD( IMR_REQWORD_HIDE) When the default register word part window receives the WM_IMEREQUEST (IMR_REGWORD, IMR_REGWORD_HIDE) message, the default register word part window hides the register word dialog. Comparison with Windows 95 Terminology IME Functions Messages IM Functions for IME ═══ Terminology ═══ ┌────────────────────────────────────────┬────────────────────────────────────────┐ │OS2 │Windows 95 │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │Input Method Instance │Input Context │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │IME Window │UI Window │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │Part │Component │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │Conversion + Result │Composition │ └────────────────────────────────────────┴────────────────────────────────────────┘ ═══ IME Functions ═══ ┌────────────────────────────────────────┬────────────────────────────────────────┐ │OS2 │Windows95 │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeInitialize │ImeInquire │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeTerminate │N/A │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeNotifyEvent │ImeSetActiveContext + ImeSelect + │ │ │ImeProcessKey + NotifyIME + ImeToAsciiEx│ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeConvertString │ImeConversionList │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeEscape │ImeEscape │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeSetConversionString │ImeSetCompositionString │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeRegisterWord │ImeRegisterWord │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeDeregisterWord │ImeUnregisterWord │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeQueryRegisterWordType │ImeGetRegisterWordStyle │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeEnumRegisterWord │ImeEnumRegisterWord │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImeDialog │ImeConfigure │ └────────────────────────────────────────┴────────────────────────────────────────┘ ═══ Messages ═══ ┌────────────────────────────────────────┬────────────────────────────────────────┐ │OS2 │Windows 95 │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │WM_QUERYIMEWINDOWCAPS │ImeInquire │ └────────────────────────────────────────┴────────────────────────────────────────┘ ═══ IM Functions for IME ═══ ┌────────────────────────────────────────┬────────────────────────────────────────┐ │OS2 │Windows 95 │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImRequestEvent │ImmGenerateMsg │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImRequestIMInstance │ImmLockIMC │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImReleaseIMInstance │ImmUnlockIMC │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImQueryIMInstanceReqCount │ImmGetIMCLockCount │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImCreateIMIPart │ImmCreateIMCC │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImDestroyIMIPart │ImmDestroyIMCC │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImQueryIMIPartSize │ImmGetIMCCSize │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImRequestIMIPart │ImmLockIMCC │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImReleaseIMIPart │ImmUnlockIMCC │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImResizeIMIPart │ImmResizeIMCC │ ├────────────────────────────────────────┼────────────────────────────────────────┤ │ImQueryIMIPartReqCount │ImmGetIMCCLockCount │ └────────────────────────────────────────┴────────────────────────────────────────┘ Reference ═══ ═══ * If the IME supports the legacy IME16, the IME can display the IME Setting panel. ═══ ═══ typedef struct _POINTL { LONG x; LONG y; } POINTL; typedef POINTL *PPOINTL; ═══ ═══ typedef struct _RECTL { LONG xLeft; LONG yBottom; LONG xRight; LONG yTop; } RECTL; typedef RECTL *PRECTL; ═══ ═══ /* structure for gradient parameters e.g. for GpiSetCharAngle */ typedef struct _GRADIENTL /* gradl */ { LONG x; LONG y; } GRADIENTL; typedef GRADIENTL *PGRADIENTL; ═══ ═══ /* font struct for Vio/GpiCreateLogFont */ typedef struct _FATTRS /* fat */ { USHORT usRecordLength; USHORT fsSelection; LONG lMatch; CHAR szFacename[FACESIZE]; USHORT idRegistry; USHORT usCodePage; LONG lMaxBaselineExt; LONG lAveCharWidth; USHORT fsType; USHORT fsFontUse; } FATTRS; typedef FATTRS *PFATTRS; /* values of fsSelection field of FATTRS structure */ #define FATTR_SEL_ITALIC 0x0001 #define FATTR_SEL_UNDERSCORE 0x0002 #define FATTR_SEL_OUTLINE 0x0008 #define FATTR_SEL_STRIKEOUT 0x0010 #define FATTR_SEL_BOLD 0x0020 /* values of fsType field of FATTRS structure */ #define FATTR_TYPE_KERNING 0x0004 #define FATTR_TYPE_MBCS 0x0008 #define FATTR_TYPE_DBCS 0x0010 #define FATTR_TYPE_ANTIALIASED 0x0020 /* values of fsFontUse field of FATTRS structure */ #define FATTR_FONTUSE_NOMIX 0x0002 #define FATTR_FONTUSE_OUTLINE 0x0004 #define FATTR_FONTUSE_TRANSFORMABLE 0x0008 /* size for fields in the font structures */ #define FACESIZE 32 ═══ ═══ /* fixed point number - implicit binary point between 2 and 3 hex digits */ typedef LONG FIXED; /* fx */ typedef FIXED *PFIXED; ═══ ═══ /* variation of SIZE used for FIXEDs */ typedef struct _SIZEF /* sizfx */ { FIXED cx; FIXED cy; } SIZEF; typedef SIZEF *PSIZEF; ═══ ═══ /* structure for size parameters e.g. for GpiCreatePS */ typedef struct _SIZEL /* sizl */ { LONG cx; LONG cy; } SIZEL; typedef SIZEL *PSIZEL; ═══ ═══ typedef ULONG (EXPENTRY REGISTERWORDENUMPROC)(PSZ, ULONG, PSZ, PVOID );