[][src]Function winput::send_inputs

pub fn send_inputs(inputs: impl AsRef<[Input]>) -> u32

Synthesizes keystrokes, mouse motions, and button clicks.

Returns

This function returns the number of events that were successfully inserted onto the keyboard or mouse 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.

Example

use winput::{Vk, Input, Action};

let inputs = [
    Input::from_vk(Vk::Shift, Action::Press),
    Input::from_vk(Vk::A, Action::Press),
    Input::from_vk(Vk::A, Action::Release),
    Input::from_vk(Vk::Shift, Action::Release),
];

winput::send_inputs(&inputs);