input_pipeline > Source layout

Reviewed on: 2022-03-22

All modules are in the src directory (parallel to this docs directory), and are referenced from src/lib.rs.

  • input_pipeline.rs defines the top-level structs needed by components that wish to instantiate an input pipeline. These are input_pipeline::InputPipeline, and input_pipeline::InputPipelineAssembly.
  • input_device.rs defines the types (e.g. structs, traits, enums) which represent input devices and input events within the library.
  • The various bindings define the structs that read from input devices exposed by /dev/class/input-report. Each binding reads fuchsia.input.report.InputReport FIDL messages, and translates the Input Reports into input_device::InputEvents.
  • The focus_listener module receives focus change notifications from Scenic, and dispatches relevant updates to FIDL peers (e.g. the shortcut manager) that need to know which fuchsia.ui.views.View has keyboard focus. Note: This is work-in-progress. See https://fxbug.dev/95901.
  • Various other modules implement input pipeline stages. A stage reads InputEvents, possibly decorating them, interpreting them, and/or transforming them to fuchsia.input.InputEvents. In the last case, the stage typically sends the message to a FIDL peer.
    • Stages which implement the InputHandler trait are called handlers.
    • All handlers are stages, but not all stages are handlers.
    • Some stages are documented in the stages folder.
  • Other modules provide testing support, or other utilities.