Writing an IME that works correctly with an Edit Control

4/8/2010

When you create an input method editor (IME), or when you port an IME between Windows Mobile Standard and Windows Mobile Classic, you may have to customize the HKEY_LOCAL_MACHINE\SYSTEM\Ime\Settings registry key to get the desired behavior in edit controls. This is particularly likely in use cases such as focus switching, and ensuring that the final character input into a password edit control is included in the composition string.

The HKEY_LOCAL_MACHINE\SYSTEM\Ime\Settings registry key is used to determine the behavior of an IME. The Settings key's value represents the following structure, where the first member is the lowest bit.

struct {
    bool m_CompositionStringGetExcluded:1;
    bool m_CompositionStringSetExcluded:1;
    bool m_DetermineOnLossOfFocus:1;
    bool m_CandidateOnKeyUp:1;
    bool m_UnderlineCompositionString:1;
    bool m_CancelOnBufferFull:1;
};

The following table describes the role of each of the structure's members.

Value : type Description

m_CompositionStringGetExcluded

Default setting is 1.

Indicates whether the composition string (undetermined string) is excluded when the user attempts to get the text from the edit control.

m_CompositionStringSetExcluded

Default setting is 1.

Determines whether the composition string is excluded when the user attempts to set the text for the edit control.

m_DetermineOnLossOfFocus

Default setting is 1.

Determines if the the composition string is finalized when thes edit control loses focus.

m_CandidateOnKeyUp

Default setting is 1.

Specifies whether to show the candidate window on key up.

m_UnderlineCompositionString

Default setting is 1.

Specifies whether to draw an underline for the composition string.

m_CancelOnBufferFull

Default setting is 1.

Determines whether to cancel the composition string when the buffer is full.

See Also

Other Resources

Working with the Input Method Editor