pub async fn text(
input: String,
key_event_duration: Duration,
registry: &mut dyn InputDeviceRegistry,
) -> Result<(), Error>Expand description
Simulates input being typed on a keyboard, with key_event_duration between key events.
§Requirements
inputmust be non-emptyinputmust only contain characters representable using the current keyboard layout and locale. (At present, it is assumed that the current layout and locale areUS-QWERTYanden-US, respectively.)
§Resolves to
Ok(())if the arguments met the requirements above, and the events were successfully injected.Err(Error)otherwise.
§Corner case handling
key_event_durationof zero is permitted, and will result in events being generated as quickly as possible.