Skip to main content

ferroui_base/input/
i_input_manager.rs

1use super::raw::IRawInputEventArgs;
2use crate::reactive::IObservable;
3use std::rc::Rc;
4
5/// Receives input from the windowing subsystem and dispatches it to
6/// interested parties for processing.
7pub trait IInputManager {
8    /// An observable that notifies on each input event received before
9    /// `process`.
10    fn pre_process(&self) -> Rc<dyn IObservable<Rc<dyn IRawInputEventArgs>>>;
11
12    /// An observable that notifies on each input event received.
13    fn process(&self) -> Rc<dyn IObservable<Rc<dyn IRawInputEventArgs>>>;
14
15    /// An observable that notifies on each input event received after
16    /// `process`.
17    fn post_process(&self) -> Rc<dyn IObservable<Rc<dyn IRawInputEventArgs>>>;
18
19    /// Processes a raw input event.
20    fn process_input(&self, e: Rc<dyn IRawInputEventArgs>);
21}