Skip to main content

InputSession

Struct InputSession 

Source
pub struct InputSession {
    pub started: Instant,
    /* private fields */
}

Fields§

§started: Instant

Implementations§

Source§

impl InputSession

Source

pub async fn open( adapter: &mut AdapterHandle, rsd: &mut RsdHandshake, video: bool, ) -> Result<Self>

video: also start the screen video stream. The audio stream alone sets up the screen-sharing session that makes touches count (2026-11-11: taps, drags, long presses, keys and buttons all work without the video; 24 of 24 first drags on a new session either way). The video is up to 6 Mbit/s while the screen moves. Over Wi-Fi the tunnel carried a seventh of that, and everything else queued behind it.

Source

pub fn media_idle_ms(&self) -> Option<u64>

Milliseconds since the phone last sent a media packet, if it ever did.

Source

pub fn reports_sent(&self) -> u64

How many touch and button reports this session has written. A gesture that fails without this number moving sent nothing to the phone.

Source

pub async fn tap(&mut self, x: u16, y: u16, hold: Duration) -> Result<()>

One finger down at (x, y), held for hold, then lifted. Coordinates are normalized 0..=65535.

Source

pub async fn double_tap(&mut self, x: u16, y: u16) -> Result<()>

Source

pub async fn drag( &mut self, from: (u16, u16), to: (u16, u16), duration: Duration, motion: Motion, ) -> Result<()>

Move one finger from from to to over duration, then lift.

Motion::Flick moves at constant speed and lifts while moving, so a list keeps coasting (a swipe). Motion::Place slows to a stop before lifting, so the content ends up moved by the finger’s distance and stays there (a scroll step, a drag-and-drop).

Source

pub async fn button( &mut self, usage_page: u64, usage: u64, hold: Duration, ) -> Result<()>

Press and release a hardware button (HID usage page / usage).

Source

pub async fn keyboard_attach(&mut self) -> Result<()>

Register a temporary hardware keyboard with the phone. While it is registered iOS hides the on-screen keyboard, so pair every attach with keyboard_detach.

Source

pub async fn keyboard_press(&mut self, combos: &[(u64, Vec<u64>)]) -> Result<()>

Press key combinations one after another on the attached keyboard. Each is a HID keyboard usage with the modifier usages held around it, e.g. (0x19, [0xE3]) for Command-V.

Source

pub async fn keyboard_detach(&mut self) -> Result<()>

Remove the temporary keyboard; this also releases any key still down and brings the on-screen keyboard back.

Source

pub async fn keys(&mut self, combos: &[(u64, Vec<u64>)]) -> Result<()>

Attach, press, detach.

Source

pub async fn key(&mut self, usage: u64, modifiers: &[u64]) -> Result<()>

One key with optional modifiers.

Source

pub async fn close(self)

Source

pub async fn abandon(self)

Stop the stream of a session given up after an error, without the orderly wait. A stream nobody stops keeps the phone encoding video.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ParallelSend for T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more