-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
windows 8.1 system's virtual keyboard not working with CefSharp / WinForms app #1054
Comments
Here is a minimal change from v39.0.2 that will exhibit the problem:
Build & run. If you use touch to select the textarea, then the cursor will be positioned properly, the textbox will highlight like it has keyboard focus, and the win8.1 virtual keyboard will appear but key presses WILL NOT add text to the textarea. If you use a mouse to click in the textarea then keypresses WILL work.
|
Have you tried this with cefclient? See the suggestions on what to include in an issue. WinForms generally stays out of the way of keyboard mucking around let alone the Win 8.1 onscreen keyboard. I wouldn't be surprised if this is an upstream CEF issue. This really seems like #985, I'm afraid. Oddly enough, Raymond Chen posted a blog today along these general lines. CefSharp wouldn't want to automatically do what Raymond is suggesting without further support to ensure the text control is still visible when the keyboard is displayed. Bill |
Bill, thank you for your suggestions. Comments below:
cefsharp v39.0.2 uses cef.sdk.3.2171.2069 . Using http://www.cefbuilds.com branch 2171 with this command:
works correctly. On a Surface Pro 3 clicking in the text box positions the cursor as expected, the win8.1 virtual keyboard appears, and typing virtual keys inserts the appropriate characters into the textarea element. This seems to suggest the problem may be in CefSharp and some difference between it and cefclient.
In that issue they are saying the virtual keyboard does not appear. In this issue, the virtual keyboard does appear. The problem is characters are not appearing in the selected text field after typing keys on the virtual/touch keyboard.
Raymond says touch keyboard does not appear automatically. With both cefsharp v39.0.2 and cefclient v3.2171.2069 and the example HTML file the touch keyboard does automatically appear. So these do not seem related. Thank you again for your help. I will pursue the insight from your suggestion to test with cefclient-- trying to understand the differences between cefclient and CefSharp example apps which have different behavior. |
Bill said:
Well not completely, at least some additional handling is added in CefSharp's WinForms wrapping layer: https://github.com/cefsharp/CefSharp/blob/master/CefSharp.WinForms/Internals/DefaultFocusHandler.cs @acoder32 I'm speculating if the touch-click even you describe above versus mouse-click behaviour fires different events and it conflicts with CefSharps additional layer of focus handling. Note this is mostly hunches from my end, still throwing it out in the hope it can lead you closer to a solution. 🍖 |
@acoder32 , Have you tried cefclient with the multithreaded message loop? CefSharp always uses the multithreaded message loop. (CEF is one thread A, while the WinForms/WPF UI is on thread B). @jornh: I suppose it's possible for that focus/activation adaptation logic could be part of the problem. I would be fairly surprised though. Bill |
Sadly, my Surface Pro 3 doesn't even have Visual Studio on it atm, and has currently been borrowed by testing, otherwise I might have taken a gander today. 😦 Bill |
My first though was |
You could be right, as I have tested this on my Transformer Book T100, without the keyboard dock, and I do think it has to do something with the I decided to test this out more, so I added |
Does setting |
Where would I set this? (I am using VB, not C#...) I tried to experiment a little bit, and where I initialized the Edit: |
Can't really help with If you build from source you can comment out the assignment. https://github.com/cefsharp/CefSharp/blob/master/CefSharp.WinForms/ChromiumWebBrowser.cs#L87 |
Okay, I will comment out that line and then build from source again. I will have to do it later, when I get home though. |
Thank you everyone for your many suggestions. I have not had time to pursue them all yet. However, I wanted to share that this post #684 related to focus has helped make it work for me. In particular it says:
To me this is a workaround as why should a mouse-click do more than a touch-click in terms of focusing a control, but for the moment it has addressed my immediate need but I wouldn't call this resolved. |
I looked at #684, but I couldn't quite tell when they suggested calling Additionally, if you want to debug the underlying issue further you could put in the code I removed in the focus fixing PR. The logging logs most of the focus/activation troublesome areas of interaction. Sadly, my Surface Pro 3 is still on lone to my team's tester. 😦 Bill |
Well, I have happy/sad news to report. I've seen this happen with a password like UI on my Surface Pro 3, but only part of the time. I set FocusHandler to null in my app and it appears to now work all of the time. 😭 Since I'm only dealing with a full screen Kiosk app, I think that's how I'll leave my app for now, but I'm going to put the focus logging goo back in on master soon. Hopefully, that will help us fix this issue. Fyi, |
For those experiencing this issue integrating https://github.com/cefsharp/CefSharp/wiki/General-Usage#multithreadedmessageloop You test using the You may need to implement your own custom You may also need to use the |
Closing this for now, if someone wants to take ownership and resolve the problem then by all means. I'm fairly confident that integrating
|
Context: I'm using CefSharp v39.0.2 to run a HTML5 web app as a winforms application.
Problem: Keyboard input is critical to this app but on win8.1 devices anywhere in the web app text can be entered (into input or textarea elements) the windows 8.1 virtual keyboard events (if a device doesn't have a physical keyboard or you're choosing not to use it) are not appearing in the text element (no characters show up). Clicks on the virtual keyboard are occurring and making click sounds, but characters do not appear in the text input elements. (fwiw, I haven't had the problem on any win7 machines-- text entry works as expected there.)
Most of the time after clicking on a text input element, the virtual keyboard appears as expected but keyboard presses do not enter any text into the element as described above. A few times I've also observed the whole app freeze (window becomes all white and unresponsive and I must kill it in the task manager).
Has anyone else experienced this on windows 8.1 when using the win 8.1 virtual keyboard with CefSharp?
These reported problems seem related but not quite the same problem:
https://bitbucket.org/chromiumembedded/cef/issue/985
#997
#952
http://www.magpcss.org/ceforum/viewtopic.php?f=14&t=10805
Another post suggested using an HTML5 keyboard as a workaround, but I'd really like to avoid adding that complexity and just use the win 8.1's keyboard which I think is the expected way to enter text in win8 apps when you're not using a physical keyboard.
The web app is complex so I am working to produce a barebones project that reproduces the problem. I will continue to debug the problem and welcome ideas on how to fix or debug this issue. I am relatively new to CefSharp-- there may be some debugging approaches more experienced CefSharp uses may suggest. Thank you!
The text was updated successfully, but these errors were encountered: