[][src]Function winput::send_keys

pub fn send_keys<I>(keys: I) -> u32 where
    I: IntoIterator,
    I::Item: Keylike

Synthesizes keystrokes according to the given iterator of keys.

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

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 retrieve additional information about this function failing to send events.

Panics

This function panics if the buffer used to store the produced inputs fails to allocate or if any of the given keys is unable to produce an Input.

Example

use winput::Vk;

let keys = vec![ Vk::A, Vk::B, Vk::C ];

winput::send_keys(keys);