Dvorak Soft Input Panel
This code sample is named DvorakSIP. It demonstrates how to create a custom Soft Input Panel (SIP) as a COM object. It is intended to help users and service providers in different regions support different languages in the SIP. The application is a COM component that implements the IInputMethod Interface.
The following events occur when the user selects this input panel, and begins tapping keys.
- The system calls the DLL containing the code for the custom SIP mechanism, which implements the IInputMethod Interface.
- The IInputMethod::Select method is called to create the input window using the Dvorak keyboard bitmap.
- The system calls IInputMethod::GetInfo to get information in an IMINFO structure about the size and other aspects of the input context.
- The system calls IInputMethod::ReceiveSipInfo to inform the input method of size, placement information. It reacts to this call by resizing itself appropriately.
- IInputMethod::RegisterCallback is called to give the input method a pointer to a IIMCallback interface. This interface is used to return keystrokes to applications.
- When the user taps a key on the keyboard, the input method recognizes the mouse event location on its keyboard bitmap. It scans the bitmap horizontally and vertically to place the tap inside a particular key.
- A large array of constants is maintained, that define the value of each key on the keyboard, and its pixel location so that this scanning mechanism can be accomplished.
- The keystroke is processed and various flags are checked such as CAPS lock, Shift, etc. Once the proper keystroke has been determined, it is returned to the application using the IIMCallback::SendCharEvents method. IIMCallback::SendVirtualKey is used if the virtual key code is desired (an example could be when the Windows Key was pressed if such a key exists on the keyboard).
- The state of the keyboard is updated as the key is no longer pressed. Code must be careful to check for sticky keys such as CAPS in this situation.
To run the code sample
Navigate to the solution file (*.sln), and double-click it. By default, the solution file is copied to the following folder:
C:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CPP\ATL\dvoraksip
Microsoft Visual Studio 2005 launches and loads the solution.
Build the solution (Ctrl+Shift+B).
Deploy the solution (F5).
To use the application
- Select the Dvorak SIP using the SIP button in the lower middle of the screen from within any application that supports the SIP (Word Mobile, Notes, etc.).
The soft input panel (SIP) is designed to support user-defined input mechanisms. By default, it includes a Standard Keyboard, a Block Recognizer, and a Letter Recognizer.
IInputMethod::UserOptionsDlg can display the simple message "There are no options for this input method." This is just to show the function of the method so you can extend it further.
For more information on hardware-specific keyboard layouts, see Device Layouts on MSDN.
If this sample is loaded at boot time as the default input method, it will only use the upper left quadrant of the SIP area.
Pocket PC SDK: Windows Mobile 6 Professional SDK
Development Environment: Visual Studio 2005.
ActiveSync: Version 4.5.