pub struct InputFusion { /* private fields */ }Expand description
Input fusion processor.
Combines touch and voice inputs that occur within a configurable time window.
Implementations§
Source§impl InputFusion
impl InputFusion
Sourcepub fn with_config(config: FusionConfig) -> Self
pub fn with_config(config: FusionConfig) -> Self
Create with custom configuration.
Sourcepub const fn config(&self) -> &FusionConfig
pub const fn config(&self) -> &FusionConfig
Get the current configuration.
Sourcepub fn set_config(&mut self, config: FusionConfig)
pub fn set_config(&mut self, config: FusionConfig)
Update the configuration.
Sourcepub fn process_touch(&mut self, touch: &TouchEvent) -> FusionResult
pub fn process_touch(&mut self, touch: &TouchEvent) -> FusionResult
Process a touch event.
Stores the touch for potential fusion with upcoming voice.
Sourcepub fn process_voice(&mut self, voice: &VoiceEvent) -> FusionResult
pub fn process_voice(&mut self, voice: &VoiceEvent) -> FusionResult
Process a voice event.
If a touch is pending within the fusion window, creates a fused intent.
Sourcepub fn process(&mut self, event: &InputEvent) -> FusionResult
pub fn process(&mut self, event: &InputEvent) -> FusionResult
Process any input event.
Sourcepub fn has_pending_touch(&self) -> bool
pub fn has_pending_touch(&self) -> bool
Check if there’s a pending touch.
Sourcepub fn is_touch_valid(&self) -> bool
pub fn is_touch_valid(&self) -> bool
Check if pending touch is still within fusion window.
Sourcepub fn clear_pending(&mut self)
pub fn clear_pending(&mut self)
Clear any pending touch.
Sourcepub fn time_remaining(&self) -> Option<Duration>
pub fn time_remaining(&self) -> Option<Duration>
Get time remaining in fusion window for pending touch.
Trait Implementations§
Source§impl Debug for InputFusion
impl Debug for InputFusion
Auto Trait Implementations§
impl Freeze for InputFusion
impl RefUnwindSafe for InputFusion
impl Send for InputFusion
impl Sync for InputFusion
impl Unpin for InputFusion
impl UnwindSafe for InputFusion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more