Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CefSharp.Wpf Can‘t support other Input Method #583

Closed
willent opened this issue Nov 10, 2014 · 16 comments
Closed

CefSharp.Wpf Can‘t support other Input Method #583

willent opened this issue Nov 10, 2014 · 16 comments
Labels
upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.
Milestone

Comments

@willent
Copy link

willent commented Nov 10, 2014

cef version:33.0.1750 r1738 cefsharp version 33.0.2.0
CefSharp.Wpf it is unable to input any Chinese。

@jornh
Copy link
Contributor

jornh commented Nov 12, 2014

I don't know anything about IME. But I searched for it here in the CefSharp repo and results for CefSharp 1 came up: https://github.com/cefsharp/CefSharp/search?q=ime&type=Issues&utf8=%E2%9C%93

Does it do the right thing if you add an OnPreviewTextInput() handler like this:

        protected override void OnPreviewTextInput(TextCompositionEventArgs e)
        {
            for (int i = 0; i < e.Text.Length; i++)
            {
                managedCefBrowserAdapter.SendKeyEvent((int)WM.CHAR, (int)e.Text[i], 0); // or WM.IME_CHAR?
            }
            base.OnPreviewTextInput(e); // maybe remove this?
        }

... to the ChromiumWebBrowser class in the CefSharp.Wpf project?

@amaitland
Copy link
Member

@jornh Worth trying in cefclient with OSR?

@jornh
Copy link
Contributor

jornh commented Nov 16, 2014

@amaitland good idea! It fails too.

It's already reported in this CEF Forum post and CEF issue 1019 vote for it there with a ⭐

@jornh jornh added the upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. label Nov 16, 2014
@wangan
Copy link

wangan commented Nov 17, 2014

It perform good when i input chinese language ,but when i input a single alphabet it become twice.
Like this:
qq 20141117092740

@jornh
Copy link
Contributor

jornh commented Nov 17, 2014

@wangan great 😄 at least that's one small step...

Comment out the case WM.CHAR: line here then https://github.com/cefsharp/CefSharp/blob/v33.1.0-pre01/CefSharp.Wpf/ChromiumWebBrowser.cs#L595

As the issue is already reported upstream I'd prefer those who need this quick work-around hack apply it locally and vote for the CEF issue mentioned above (or maybe even submit a patch to CEF! The issue links to a similar patch for Mac - so I guess it shouldn't be to hard to implement for those who know about input method APIs ... ) then we don't need to do anything in CefSharp when the issue is resolved upstream.

@ralphmayr
Copy link
Contributor

@jornh We have the same issue running CefSharp 37 (the prerelease, to be precise). The fix you proposed definitely resolves the issue for us, but we would prefer switching to the CefSharp 37 release as soon as this is out instead of building it locally including that change.
Do you see any chance to incorporate your fix in CefSharp 37?

@ssdyz
Copy link

ssdyz commented Mar 30, 2015

Is this problem solved? Very worried, please do me a favor, thank you

@amaitland
Copy link
Member

Updating link to cef bitbucket site https://bitbucket.org/chromiumembedded/cef/issue/1019

Issue is still unsolved, you can try the workaround proposed above.

@ralphmayr
Copy link
Contributor

I created a PR (#934) that contains the fix proposed in this issue - as mentioned before, I'm confident that this fixed the issue for most cases.
We'd be very grateful if this would make it into the next CefSharp release ;)

ralphmayr added a commit to ralphmayr/CefSharp that referenced this issue Apr 10, 2015
Reverted changes from 77b433b and
instead exposed SendKeyEvent in the ChromiumWebBrowser to be able to
move the handler for OnPreviewTextInput to the WPF example.
@amaitland amaitland reopened this Jul 27, 2015
@amaitland
Copy link
Member

So the upstream issue has been marked as closed
https://bitbucket.org/chromiumembedded/cef/issues/1019

Anyone care to take the current master for a spin and see how it goes? (Will of course have to comment out https://github.com/cefsharp/CefSharp/blob/master/CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs#L30)

@amaitland
Copy link
Member

I've removed the workaround from master see c7c9058

As the upstream issue has been resolved I'm closing this. (If someone can still reproduce the problem with latest master then this can be reopened).

@luciusli
Copy link

luciusli commented Sep 4, 2015

I can still reproduce this problem. FYI cefclient build 2454 from cefbuilds.com works flawlessly.

@amaitland
Copy link
Member

FYI cefclient build 2454 from cefbuilds.com works flawlessly.

Just confirming that you ran cefclient with the --off-screen-rendering-enabled command line argument?

@luciusli
Copy link

luciusli commented Sep 4, 2015

I didn't but if run with that argument, the character selection box is misaligned.

@amaitland
Copy link
Member

WPF uses off screen rendering, without that argument it behaves like the WinForms version.

If the problem still persists then someone with a vested interest in IME will have to troubleshoot the issue.

@amaitland amaitland reopened this Sep 4, 2015
@amaitland
Copy link
Member

Looks like the problem still exists, rather than multiple issues, closing this one in favor of #1262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.
Projects
None yet
Development

No branches or pull requests

7 participants