Skip to content

Commit

Permalink
Add workaround for Chinese IME
Browse files Browse the repository at this point in the history
Fixes #314
  • Loading branch information
canton7 committed Nov 6, 2016
1 parent 1558926 commit bf0b89a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/SyncTrayzor/Pages/ViewerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,21 @@ private void InitializeBrowser(ChromiumWebBrowser webBrowser)
webBrowser.ExecuteScriptAsync(addFolderBrowse);
}
};

// Chinese IME workaround, copied from
// https://github.com/cefsharp/CefSharp/commit/c7c90581da7ed3dda80fd8304a856462d133d9a7
webBrowser.PreviewTextInput += (o, e) =>
{
var host = webBrowser.GetBrowser().GetHost();
var keyEvent = new KeyEvent();
foreach (var character in e.Text)
{
keyEvent.WindowsKeyCode = character;
keyEvent.Type = KeyEventType.Char;
host.SendKeyEvent(keyEvent);
}
e.Handled = true;
};
}

public void RefreshBrowserNukeCache()
Expand Down

0 comments on commit bf0b89a

Please sign in to comment.