Function winput::send_str[][src]

pub fn send_str(s: &str) -> u32

Synthesizes keystrokes following the given string reference.

Note that this function needs to allocate a buffer to store the inputs produced by the characters.

The function returns the number of inputs that were successfully inserted into the keyboard input stream.

If no events were successfully sent, the input stream was already blocked by another thread. You can use winput::WindowsError::from_last_error to retreive additional information about this function failing to send events.

Panics

This function panics if the buffer fails to allocate or if any of the given character fails to produce an Input.

Example

winput::send_str("Hello, world");