FlutterWayland / flutter_wlroots

Wayland compositor embedder and library for Flutter. Built with Wlroots.
MIT License
30 stars 5 forks source link

Implement keyboard input handling #1

Open hansihe opened 2 years ago

hansihe commented 2 years ago

This issue consists of several parts, in what I would consider the most convenient implementation order:

  1. Forward input from wlroots backend to the flutter engine. This includes handling the new keyboard signal emitted by wlroots and registering handlers for key events which call into the flutter engine API.
  2. Implement keyboard event handling in SurfaceWidget. This would involve introducing a focus node and adding a handler for keyboard events. Implementing focus-on-click vs focus-on-hover (or some other mechanism) is best left to the consumer, but the dart library should make this easy.
  3. Make sure the surface receives/loses keyboard focus when the focus node receives/loses focus. This involves making a new message handler for managing focus changes in the native code, then forwarding that to wlroots. This would then be called by the SurfaceWidget when the focus node changes state.
  4. Make sure the surface receives keyboard events correctly. This involves making a new message handler for keyboard events in native code which forwards the events to wlroots. This would be called by the SurfaceWidget when input events are received.