Compartir a través de


Editing the Composition String (Windows Embedded CE 6.0)

1/6/2010

If the Input Method Editor (IME) user interface (UI) receives the control keys for string editing, it must edit the composition buffers managed by the conversion service.

To request the conversion service to edit the composition buffers, the IME UI calls the IImeIPoint2::ControlIME method with an appropriate function identifier. For example, if you want to move the caret left, you must call the ControlIME method with the IPCTRL_CARETLEFT function identifier. If you want to delete a character before the caret, call the ControlIME method with the IPCTRL_CARETBACKSPACE function identifier. You may create a mapping table to map control keys to the corresponding function identifiers.

Because the composition string is updated by this call, IME UI will need to display the updated composition string for users. IME UI calls IImeIPoint2::UpdateContext method to request the conversion service to send back the composition buffer contents through the IImeIPointNotifySink callback function.

The following code sample shows how to edit the composition buffers by moving the caret left:

// Move the caret left and backspace
pIP->ControlIME(IPCTRL_CARETLEFT, IPCTRLPARAM_DEFAULT);
pIP->ControlIME(IPCTRL_CARETBACKSPACE, IPCTRLPARAM_DEFAULT);
pIP->UpdateContext(TRUE);

See Also

Concepts

Accessing the Conversion Service
Creating a Notification Sink
Processing User Input from the Keyboard
Processing User Input with Alternatives
Converting a Composition String
Creating the Candidate List
Determining the Composition String

Other Resources

Using the IImeIPoint2 Interface