-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Need a way to send synchronous keyboard events from embedder to Dart and get a response. #33521
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
Comments
Relatedly, there have been general conversations several times in the past about the need for a formal keyboard API in embedding.h, rather than passing text input and key events via a platform channel. |
b/140830852 |
I have a Wayland Embedder client working with the exception of Keyboard. I send key events, and they're dropped by the engine. It looks like I need to modify the Engine to register a "flutter/keyevent" handler. Will this change enable a default channel in the embedder for keyevents? |
The listener is in the framework code, and is always present. You should not need to modify the engine.
No (per above), but it will provide an explicit API in embedder.h that embedders should use instead of the message channel. |
IIRC, someone were experimenting on merging Platform Runner & UI Runner. Would it be another option? |
This was fixed by the various delayed key event changes. Closing. |
This can be moved to "Done" in project "Desktop Features", right? |
@nilsux Yes, done. Thanks. |
Sorry to bump an old issue, but I'm having the same problem with this comment and I'm not sure where to ask. I have successfully embedded Flutter in my OpenGL app using software renderer, using the official 2.0.1 build (using official artifacts from the wiki page. Rendering & mouse/pointer events works fine. However, I'm not able to send or receive any platform messages to/from the flutter engine:
Also if I use a native plugin, if I invoke MethodChannel from Flutter/Dart side, it never returns. For the project args, I only filled Are there other prerequisites for communication with flutter using platform messages? Thanks! |
@siavee That has nothing to do with this issue. Most likely you aren't servicing the engine tasks (either by providing a platform task runner, or regularly calling the deprecated If that's not it, you should either file a new issue or use a resource like StackOverlfow or Discord, since this issue was about adding specific new functionality for key events. |
@stuartmorgan Thanks for the response! That's probably it, I'll try providing a task runner and I'm very sorry about the noise. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Uh oh!
There was an error while loading. Please reload this page.
Internal: b/140830852
Similar to #28310, we need to be able to synchronously take keyboard events from the platform embedder, pass them to Dart to be handled, and if they are not handled, then pass them back to the platform to give it a chance to handle them.
This is needed so that add2app has a hope of working in environments with keyboards (like desktops), and so that we can capture keys before they get to a soft keyboard, as requested way back in #5986 (and has come up repeatedly).
We need a way to determine whether key events have been handled, synchronously, so that embedders know whether to continue propagating them in the native view hierarchy.
It needs to be synchronous because key events need to be responded to synchronously on host platforms.
The text was updated successfully, but these errors were encountered: