Page 1 of 1

FYI: How to implement text service input with IME

PostPosted: Thu Jan 28, 2010 9:17 am
by heshiming
The current revision of CEF references test_shell, which contains no implementation of IME (Input Method Editor) based keyboard input (mostly for East Asian Languages) and others such as voice based input. Form elements in chromium aren't using the Windows Edit Control, therefore the host window has to implement specific IME details. Otherwise IME input will either be broken or impossible.

Luckily, we have a good reference in the chromium project itself, the existing implementations are suitable for the current revision of CEF. The steps to provide IME support in CEF are as below:
1. Include chromium\src\chrome\browser\ime_input.cc and chromium\src\chrome\browser\ime_input.h in libcef_static project, no modification is needed.
2. Consult chromium\src\chrome\browser\renderer_host\render_widget_host_view_win.cc and chromium\src\chrome\renderer\render_widget.cc for usage on ImeInput class and required message handlers.
3. In CEF's webwidget_host.h and webwidget_host.cc, add the ImeInput instance, message handlers for WM_IME_SETCONTEXT; WM_IME_STARTCOMPOSITION; WM_IME_COMPOSITION; WM_IME_ENDCOMPOSITION, and other details such as OnInputLangChange and IMEUpdateStatus.
4. Because CEF is not using WTL, it's important to review |bHandled| argument in original message handlers (in render_widget_host_view_win.cc) to decide whether to return "0" or "DefWindowProc".
5. Chromium's implementation involves IPC, but CEF doesn't, we can control |webwidget_| directly, like the way "render_widget.cc" did (calling WebKit's internal support for IME).

This is a short guide for anyone who would like to include the IME capability in CEF based apps. And to Marshall, you probably would also need custom IME implementation for the new edition of CEF you talked about.

Re: FYI: How to implement text service input with IME

PostPosted: Fri Jan 29, 2010 9:32 am
by magreenblatt
Thanks for this information. If the current Chromium browser process window is embedded in the client application (as proposed for the next version of CEF) would it still be necessary for the client application to implement this directly?

Re: FYI: How to implement text service input with IME

PostPosted: Fri Jan 29, 2010 8:23 pm
by heshiming
magreenblatt wrote:Thanks for this information. If the current Chromium browser process window is embedded in the client application (as proposed for the next version of CEF) would it still be necessary for the client application to implement this directly?

Well I thought you were going to create something similar to chromium itself, that talks to background "render_widget" processes. This way, the "render_widgets" are already IME-aware, but you are still responsible for processing these window messages and dispatch them through IPC.

On the other hand, if the embedded chromium can process messages itself, it's probably okay to ignore it.

Re: FYI: How to implement text service input with IME

PostPosted: Mon Mar 22, 2010 3:05 am
by googol4u
heshiming wrote:The current revision of CEF references test_shell, which contains no implementation of IME (Input Method Editor) based keyboard input (mostly for East Asian Languages) and others such as voice based input. Form elements in chromium aren't using the Windows Edit Control, therefore the host window has to implement specific IME details. Otherwise IME input will either be broken or impossible.

Luckily, we have a good reference in the chromium project itself, the existing implementations are suitable for the current revision of CEF. The steps to provide IME support in CEF are as below:
1. Include chromium\src\chrome\browser\ime_input.cc and chromium\src\chrome\browser\ime_input.h in libcef_static project, no modification is needed.
2. Consult chromium\src\chrome\browser\renderer_host\render_widget_host_view_win.cc and chromium\src\chrome\renderer\render_widget.cc for usage on ImeInput class and required message handlers.
3. In CEF's webwidget_host.h and webwidget_host.cc, add the ImeInput instance, message handlers for WM_IME_SETCONTEXT; WM_IME_STARTCOMPOSITION; WM_IME_COMPOSITION; WM_IME_ENDCOMPOSITION, and other details such as OnInputLangChange and IMEUpdateStatus.
4. Because CEF is not using WTL, it's important to review |bHandled| argument in original message handlers (in render_widget_host_view_win.cc) to decide whether to return "0" or "DefWindowProc".
5. Chromium's implementation involves IPC, but CEF doesn't, we can control |webwidget_| directly, like the way "render_widget.cc" did (calling WebKit's internal support for IME).

This is a short guide for anyone who would like to include the IME capability in CEF based apps. And to Marshall, you probably would also need custom IME implementation for the new edition of CEF you talked about.


I have some issues concerning IME. Is it the same reason?

http://code.google.com/p/chromiumembedd ... tail?id=77

http://code.google.com/p/chromium/issue ... l?id=38417

Re: FYI: How to implement text service input with IME

PostPosted: Thu Dec 09, 2010 12:13 pm
by shileiyu
googol4u wrote:
heshiming wrote:The current revision of CEF references test_shell, which contains no implementation of IME (Input Method Editor) based keyboard input (mostly for East Asian Languages) and others such as voice based input. Form elements in chromium aren't using the Windows Edit Control, therefore the host window has to implement specific IME details. Otherwise IME input will either be broken or impossible.

Luckily, we have a good reference in the chromium project itself, the existing implementations are suitable for the current revision of CEF. The steps to provide IME support in CEF are as below:
1. Include chromium\src\chrome\browser\ime_input.cc and chromium\src\chrome\browser\ime_input.h in libcef_static project, no modification is needed.
2. Consult chromium\src\chrome\browser\renderer_host\render_widget_host_view_win.cc and chromium\src\chrome\renderer\render_widget.cc for usage on ImeInput class and required message handlers.
3. In CEF's webwidget_host.h and webwidget_host.cc, add the ImeInput instance, message handlers for WM_IME_SETCONTEXT; WM_IME_STARTCOMPOSITION; WM_IME_COMPOSITION; WM_IME_ENDCOMPOSITION, and other details such as OnInputLangChange and IMEUpdateStatus.
4. Because CEF is not using WTL, it's important to review |bHandled| argument in original message handlers (in render_widget_host_view_win.cc) to decide whether to return "0" or "DefWindowProc".
5. Chromium's implementation involves IPC, but CEF doesn't, we can control |webwidget_| directly, like the way "render_widget.cc" did (calling WebKit's internal support for IME).

This is a short guide for anyone who would like to include the IME capability in CEF based apps. And to Marshall, you probably would also need custom IME implementation for the new edition of CEF you talked about.


I have some issues concerning IME. Is it the same reason?

http://code.google.com/p/chromiumembedd ... tail?id=77

http://code.google.com/p/chromium/issue ... l?id=38417


Because test_shell response WM_IME_CHAR and forware the message to DefWindowProc again.
so system generated a duplicated WM_CHAR