pub struct MouseInjectorHandler {
pub inspect_status: InputHandlerStatus,
/* private fields */
}
Expand description
A MouseInjectorHandler
parses mouse events and forwards them to Scenic through the
fidl_fuchsia_pointerinjector protocols.
Fields§
§inspect_status: InputHandlerStatus
The inventory of this handler’s Inspect status.
Implementations§
Source§impl MouseInjectorHandler
impl MouseInjectorHandler
Sourcepub async fn new(
display_size: Size,
cursor_message_sender: Sender<CursorMessage>,
input_handlers_node: &Node,
metrics_logger: MetricsLogger,
) -> Result<Rc<Self>, Error>
pub async fn new( display_size: Size, cursor_message_sender: Sender<CursorMessage>, input_handlers_node: &Node, metrics_logger: MetricsLogger, ) -> Result<Rc<Self>, Error>
Creates a new mouse handler that holds mouse pointer injectors. The caller is expected to spawn a task to continually watch for updates to the viewport. Example: let handler = MouseInjectorHandler::new(display_size).await?; fasync::Task::local(handler.clone().watch_viewport()).detach();
§Parameters
display_size
: The size of the associated display.cursor_message_sender
: A [Sender
] used to communicate the current cursor state.
§Errors
If unable to connect to pointerinjector protocols.
Sourcepub async fn new_with_config_proxy(
configuration_proxy: SetupProxy,
display_size: Size,
cursor_message_sender: Sender<CursorMessage>,
input_handlers_node: &Node,
metrics_logger: MetricsLogger,
) -> Result<Rc<Self>, Error>
pub async fn new_with_config_proxy( configuration_proxy: SetupProxy, display_size: Size, cursor_message_sender: Sender<CursorMessage>, input_handlers_node: &Node, metrics_logger: MetricsLogger, ) -> Result<Rc<Self>, Error>
Creates a new mouse handler that holds mouse pointer injectors. The caller is expected to spawn a task to continually watch for updates to the viewport. Example: let handler = MouseInjectorHandler::new_with_config_proxy(config_proxy, display_size).await?; fasync::Task::local(handler.clone().watch_viewport()).detach();
§Parameters
configuration_proxy
: A proxy used to get configuration details for pointer injection.display_size
: The size of the associated display.cursor_message_sender
: A [Sender
] used to communicate the current cursor state.
§Errors
If unable to get injection view refs from configuration_proxy
.
If unable to connect to pointerinjector Registry protocol.
Sourcepub async fn watch_viewport(self: Rc<Self>)
pub async fn watch_viewport(self: Rc<Self>)
Watches for viewport updates from the scene manager.