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: InputHandlerStatusThe 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.
Sourcepub async fn register_listener_proxy(
self: &Rc<Self>,
proxy: TouchButtonsListenerProxy,
)
pub async fn register_listener_proxy( self: &Rc<Self>, proxy: TouchButtonsListenerProxy, )
§Parameters
proxy: A new listener proxy to send events to.
Trait Implementations§
Source§impl BatchInputHandler for TouchInjectorHandler
impl BatchInputHandler for TouchInjectorHandler
Source§fn handle_input_events<'async_trait>(
self: Rc<Self>,
events: Vec<InputEvent>,
) -> Pin<Box<dyn Future<Output = Vec<InputEvent>> + 'async_trait>>where
Self: 'async_trait,
fn handle_input_events<'async_trait>(
self: Rc<Self>,
events: Vec<InputEvent>,
) -> Pin<Box<dyn Future<Output = Vec<InputEvent>> + 'async_trait>>where
Self: 'async_trait,
Source§impl Handler for TouchInjectorHandler
impl Handler for TouchInjectorHandler
Auto Trait Implementations§
impl !Freeze for TouchInjectorHandler
impl !RefUnwindSafe for TouchInjectorHandler
impl Send for TouchInjectorHandler
impl !Sync for TouchInjectorHandler
impl Unpin for TouchInjectorHandler
impl !UnwindSafe for TouchInjectorHandler
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more