Struct hookmap_core::common::handler::EventHandler [−][src]
Expand description
An optional input event handler.
Implementations
Creates a new EventHandler<E>
with None
.
Examples
use hookmap_core::{EventHandler, ButtonEvent}; let handler = EventHandler::<ButtonEvent>::new();
pub fn register_handler<F>(&self, generator: F) where
F: FnMut(E) -> Box<dyn EventCallback> + Send + 'static,
pub fn register_handler<F>(&self, generator: F) where
F: FnMut(E) -> Box<dyn EventCallback> + Send + 'static,
Registers a callback function.
Calls the handler in another thread if the handler is registered.