pub struct TouchInjectorHandler {
pub inspect_status: InputHandlerStatus,
/* private fields */
}
Expand description
An input handler that parses touch 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 TouchInjectorHandler
impl TouchInjectorHandler
Sourcepub async fn new(
display_size: Size,
input_handlers_node: &Node,
metrics_logger: MetricsLogger,
) -> Result<Rc<Self>, Error>
pub async fn new( display_size: Size, input_handlers_node: &Node, metrics_logger: MetricsLogger, ) -> Result<Rc<Self>, Error>
Creates a new touch handler that holds touch pointer injectors. The caller is expected to spawn a task to continually watch for updates to the viewport. Example: let handler = TouchInjectorHandler::new(display_size).await?; fasync::Task::local(handler.clone().watch_viewport()).detach();
§Parameters
display_size
: The size of the associated touch display.
§Errors
If unable to connect to pointerinjector protocols.
Sourcepub async fn new_with_config_proxy(
configuration_proxy: SetupProxy,
display_size: Size,
input_handlers_node: &Node,
metrics_logger: MetricsLogger,
) -> Result<Rc<Self>, Error>
pub async fn new_with_config_proxy( configuration_proxy: SetupProxy, display_size: Size, input_handlers_node: &Node, metrics_logger: MetricsLogger, ) -> Result<Rc<Self>, Error>
Creates a new touch handler that holds touch pointer injectors. The caller is expected to spawn a task to continually watch for updates to the viewport. Example: let handler = TouchInjectorHandler::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 touch display.
§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.