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

WPF - IME Windows 8.1/10/11 #1262

Open
ay2015 opened this issue Sep 10, 2015 · 57 comments · Fixed by #2973 or #3054
Open

WPF - IME Windows 8.1/10/11 #1262

ay2015 opened this issue Sep 10, 2015 · 57 comments · Fixed by #2973 or #3054

Comments

@ay2015
Copy link

ay2015 commented Sep 10, 2015

I use the project from official website and version '41.0.1' ,when I design a wonderful window,I have to set variable ''AllowsTransparency" to "true", “WindowStyle” to "None",I edited the ‘MainWindow.xaml’ ,set variable ''AllowsTransparency" to "true", “WindowStyle” to "None",and run.
the problem: input tag from html can't use other IME,but character is Ok,how can I solve it?
Thanks for you

@amaitland amaitland added the upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. label Sep 11, 2015
@amaitland amaitland changed the title WPF DIY Window allowtransparent WPF IME Windows 8.1 Sep 11, 2015
@amaitland amaitland changed the title WPF IME Windows 8.1 WPF IME Windows 8.1/10 Sep 11, 2015
@amaitland amaitland added the wpf label Sep 16, 2015
@TyrWang
Copy link

TyrWang commented Nov 16, 2016

@amaitland
Copy link
Member

https://bitbucket.org/chromiumembedded/cef/issues/1675/inline-ime-support-nstextinput-protocol-in

I have created wrappers for the methods exposed see fdd0889 This takes care of the C++ step, now it's up to someone else to finish the implementation and map/forward the relevant WPF events. I know nothing about IME, I have not tested the changes, so make sure you double check they're mapped correctly. CEF includes an example of as part of https://bitbucket.org/chromiumembedded/cef/commits/f7014be

Please don't ask me questions about this as I've not used the new API methods, it's up to someone else to figure out. If you need to ask follow up questions about the CEF API do so at http://magpcss.org/ceforum/viewforum.php?f=6

@amaitland
Copy link
Member

I intend to cleanup this issue, removing unnecessary comments and condensing the issue down to the relevant information for the current version. I will do this in roughly two weeks. If there are objections then I will close and lock this issue and create new issue that has only the relevant information and provide a link in this issue.

@cefsharp cefsharp deleted a comment from ay2015 Mar 6, 2018
@cefsharp cefsharp deleted a comment from ay2015 Mar 6, 2018
@cefsharp cefsharp deleted a comment from ay2015 Mar 6, 2018
@cefsharp cefsharp deleted a comment from ay2015 Mar 6, 2018
@cefsharp cefsharp deleted a comment from tylerlong Mar 6, 2018
@cefsharp cefsharp deleted a comment from h82258652 Mar 6, 2018
@cefsharp cefsharp deleted a comment from xiangwan Mar 6, 2018
@karthikeyancdm
Copy link

Thank you, @billshinji
Please let me know the build number which has the fix for #3455, so that I can test it out.

@billshinji
Copy link
Contributor

It is merged into the master so I expect you can test it on the next release (v89) if everything goes all right. Or you can download the master code files right now and build yourself. :-)

@karthikeyancdm
Copy link

Hi @billshinji
While testing this we found few issues which are listed below, it will be very helpful for us if you could fix those issues. Would you please help to fix them? Please.

Issue 1: When Japanese IME is used, the cursor position shifts before the first character when "space" is pressed to select words from dictionary. For e.g. set the Japanese IME to "Hiragana" and input "nihongo", then press "space", please observe that cursor moves before the string "日本語", cursor is expected to be placed after the string "日本語".

Issue 2: When cursor is placed before the string "日本語", try to move the cursor by pressing "right arrow key", the cursor is not moving to right.

Issue 3: If the "password field", we expect IME to be disabled, but IME is not getting disabled. So the characters we input in the password field are not correct (i.e. Hiragana is selected in the IME), because the IME converts the password characters to Japanese scripts and those characters are visible while typing password.

Some of these IME issues are noted while using Korean IME as well. Please let me know if you need more information on this regard.

@billshinji
Copy link
Contributor

@karthikeyancdm
I will look into the problems and see if I can help :-)

@karthikeyancdm
Copy link

@billshinji
Could you help with the above problems with Japanese IME? Many thanks in advance!

@billshinji
Copy link
Contributor

I have noticed the symptoms but I am in the middle of developing an important project at work. It should be done by the end of June. I hope I can spare some time before the middle of June though. NOT that I can fix those issues, :-) but I will try!

@billshinji
Copy link
Contributor

@karthikeyancdm I've been digging the issue almost for a week now but frankly I am having a hard time struggling with Windows' IME APIs (called IMM). The subject is fairly new to me so I think it's better to 'learn' some basics of the API set first ... While I am doing these crazy trial-and-error things, I hope someone who is expert of IME may help resolve this issue for good. :-) Anyway I'll let you know if I manage to resolve the issues out of pure luck ... Thank you.

@igandrews
Copy link
Contributor

I couldn't find any official documentation regarding the usage of the GCS_CURSORPOS but it seems like at least in WPF MS is ignoring that value and positioning at the end of the string if the neither the character before nor after the specified cursor position is a new character (by considering the attributes of the composition as gotten here). In the case of space the string is being replaced/changed. Technically they are setting their _caretOffset to -1 but elsewhere they are interpreting that as the end. So you could probably change where the IMEHandler gets the attributes and make a similar change?

@BigerXie
Copy link

BigerXie commented Dec 4, 2021

browser.WpfKeyboardHandler = new CefSharp.Wpf.Experimental.WpfImeKeyboardHandler(browser);

Hi, I have used WpfImeKeyboardHandler in my project, I found if I invoke browser.reload(), my IME cannot switch between Chinese and English, Can you help me fix it?

@nameofSEOKWONHONG
Copy link

browser.WpfKeyboardHandler = new CefSharp.Wpf.Experimental.WpfImeKeyboardHandler(browser);

Hi. I am a Korean user. I set the handler and it worked perfectly.
Thanks for your efforts.

@amaitland
Copy link
Member

@nameofSEOKWONHONG Thanks for the feedback.

@amaitland
Copy link
Member

I was thinking we could default to the WpfImeKeyboardHandler when IME is detected in WPF.
Can anyone confirm the following works? Or if someone has a better suggestion please provide a code example.

if (InputMethod.Current.ImeState == InputMethodState.On)
{
    browser.WpfKeyboardHandler = new CefSharp.Wpf.Experimental.WpfImeKeyboardHandler(browser);
}

@igandrews
Copy link
Contributor

The ImeState could change while the control has focus. If it matters I use the WpfImeKeyboardHandler always - set during construction - and haven't come across any issues with using it other than bugs in the IME handling. Which reminds me I found another issue and will submit a PR for it when I have some time.

@amaitland
Copy link
Member

Thanks for the feedback. The intention would be to use the IME keyboard handler if appropriate for the current user (hope that makes sense)

@Kumhy

This comment was marked as off-topic.

@amaitland

This comment was marked as off-topic.

@Kumhy

This comment was marked as off-topic.

@amaitland

This comment was marked as off-topic.

@amaitland amaitland changed the title WPF IME Windows 8.1/10 WPF - IME Windows 8.1/10/11 Jun 30, 2022
@cdz1980

This comment was marked as off-topic.

@amaitland

This comment was marked as off-topic.

@amaitland
Copy link
Member

The intention would be to use the IME keyboard handler if appropriate for the current user (hope that makes sense)

PR #4439 is available for review/testing. Anyone interested please test and provide feedback.

@AntaresXXX
Copy link

Hello, I am a Chinese developer. I am testing with a Chinese IME, and it works fine. However, there is a minor flaw: when I press the first key, the IME popup box does not appear at the expected location, but instead, it appears at the bottom right corner. When the second key is pressed, the IME popup box returns to the correct position.

@igandrews
Copy link
Contributor

igandrews commented Jul 28, 2023

Hello, I am a Chinese developer. I am testing with a Chinese IME, and it works fine. However, there is a minor flaw: when I press the first key, the IME popup box does not appear at the expected location, but instead, it appears at the bottom right corner. When the second key is pressed, the IME popup box returns to the correct position.

This isn't cefsharp or if it is it requires additional infrastructure in cef itself. I reported this to them a while back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment