Skip to main content

PointerInputHandler

Trait PointerInputHandler 

Source
pub trait PointerInputHandler: Any {
    // Required methods
    fn clone_handler(&self) -> Box<dyn PointerInputHandler>;
    fn on_event(&mut self, event: &PointerEvent) -> bool;

    // Provided methods
    fn sync(&mut self, next: &dyn PointerInputHandler) { ... }
    fn on_attach(&mut self) { ... }
    fn on_detach(&mut self) { ... }
}
Expand description

Receives the pointer events of one hit region.

on_event returns true when it handled the event; that consumes it so ancestors in the main pass do not also react.

Required Methods§

Source

fn clone_handler(&self) -> Box<dyn PointerInputHandler>

Build a fresh handler with the same configuration and no runtime state.

Source

fn on_event(&mut self, event: &PointerEvent) -> bool

Provided Methods§

Source

fn sync(&mut self, next: &dyn PointerInputHandler)

Copy configuration from a freshly built handler into this one, leaving runtime state (press position, accumulated drag) alone.

Source

fn on_attach(&mut self)

Source

fn on_detach(&mut self)

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§