CefSharp 无法输入中文的问题

2022-10-14,

在cefsharp75版本,使用了wpfimekeyboardhandler支持后,无法支持搜狗中文输入法

 

其中的一个修复方案:

在chrominumwebbrowser中,添加焦点事件的重写,对inputmethod相关进行修改

  • setisinputmethodenabled  -- 是否可输入中文
  • setisinputmethodsuspended -- 设置ime关掉
 1     protected override void ongotfocus(routedeventargs e)
 2     {
 3         inputmethod.setisinputmethodenabled(this, true);
 4         inputmethod.setisinputmethodsuspended(this, true);
 5         base.ongotfocus(e);
 6     }
 7 
 8     protected override void onlostfocus(routedeventargs e)
 9     {
10         base.onlostfocus(e);
11         inputmethod.setisinputmethodenabled(this, false);
12         inputmethod.setisinputmethodsuspended(this, false);
13     }

 

《CefSharp 无法输入中文的问题.doc》

下载本文的Word格式文档,以方便收藏与打印。