pub struct InputSession {
pub started: Instant,
/* private fields */
}Fields§
§started: InstantImplementations§
Source§impl InputSession
impl InputSession
Sourcepub async fn open(
adapter: &mut AdapterHandle,
rsd: &mut RsdHandshake,
video: bool,
) -> Result<Self>
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.
Sourcepub fn media_idle_ms(&self) -> Option<u64>
pub fn media_idle_ms(&self) -> Option<u64>
Milliseconds since the phone last sent a media packet, if it ever did.
Sourcepub fn reports_sent(&self) -> u64
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.
Sourcepub async fn tap(&mut self, x: u16, y: u16, hold: Duration) -> Result<()>
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.
pub async fn double_tap(&mut self, x: u16, y: u16) -> Result<()>
Sourcepub async fn drag(
&mut self,
from: (u16, u16),
to: (u16, u16),
duration: Duration,
motion: Motion,
) -> Result<()>
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).
Sourcepub async fn pinch(&mut self, plan: &Plan) -> Result<()>
pub async fn pinch(&mut self, plan: &Plan) -> Result<()>
Two fingers moving together or turning, then lifted. Every frame counts
in reports_sent.
Press and release a hardware button (HID usage page / usage).
Sourcepub async fn keyboard_attach(&mut self) -> Result<()>
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.
Sourcepub async fn keyboard_press(&mut self, combos: &[(u64, Vec<u64>)]) -> Result<()>
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.
Sourcepub async fn keyboard_detach(&mut self) -> Result<()>
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.
Sourcepub async fn key(&mut self, usage: u64, modifiers: &[u64]) -> Result<()>
pub async fn key(&mut self, usage: u64, modifiers: &[u64]) -> Result<()>
One key with optional modifiers.