flutter-webview-windows
flutter-webview-windows copied to clipboard
Controlling Input-Fields without Hardware-Keyboard in WebView
Hello there,
I want to be able to use a Virtual Keyboard (Overlay)
in combination with this plugin, but I cannot send KeyPressed-Events to the WebView. What options do I have if my customer will not have any hardware keyboard?
I saw that it is possible to execute JavaScript with this plugin, but it seems that for security reasons it is not allowed to simulate keystrokes programatically.
Note: Manually firing an event does not generate the default action associated with that event. For example, manually firing a key event does not cause that letter to appear in a focused text input. In the case of UI events, this is important for security reasons, as it prevents scripts from simulating user actions that interact with the browser itself.
Here's a StackOverflow-question regarding the KeyPress-Events.
My current solution is to load jquery
and manipulate the input-values.
But this feels very insecure and not clean at all.
Unfortunately, WebView2 doesn't provide an API for submitting keypress events. So I don't think there's a better way than using JS.
Is it possible to expose javascript-variables to dart/flutter?
@jnschulze do you think it's possible to inject an entire javascript overlay keyboard like this? https://virtual-keyboard.js.org/
Could this break? What are the advantages? What are the drawbacks?