Skip to main content

ferroui_linuxframebuffer/input/
i_input_backend.rs

1//! An input backend (the port of `IInputBackend.cs`).
2
3use super::IScreenInfoProvider;
4use crate::raw_event_grouping::RawEvent;
5use ferroui_base::input::IInputRoot;
6use std::rc::Rc;
7
8pub trait IInputBackend {
9    /// Starts the backend. `on_input` is called on the UI thread, where
10    /// raw input events live (the reference calls it on the thread of the
11    /// backend and the top-level posts the event).
12    fn initialize(&self, info: Rc<dyn IScreenInfoProvider>, on_input: Rc<dyn Fn(RawEvent)>);
13
14    fn set_input_root(&self, root: Rc<dyn IInputRoot>);
15}