pub fn send_inputs(inputs: &[Input]) -> Result<usize, std::io::Error> {
    if inputs.is_empty() {
        return Ok(0);
    }

    let mut inputs: Vec<INPUT> = inputs.iter().map(Into::into).collect();

    let num_processed = unsafe {
        SendInput(
            inputs.len() as u32,
            inputs.as_mut_ptr(),
            std::mem::size_of::<INPUT>() as i32,
        )
    };

    if num_processed == 0 {
        Err(std::io::Error::last_os_error())
    } else {
        Ok(num_processed as usize)
    }
}
/// Send mouse, keyboard, and hardware inputs
Send mouse, keyboard, and hardware inputs
Send mouse keyboard and hardware inputs
pub fn send_inputs(inputs: &[Input]) -> Result<usize, std::io::Error> {
    if inputs.is_empty() {
        return Ok(0);
    }
    let mut inputs: Vec<INPUT> = inputs.iter().map(Into::into).collect();
    let num_processed = unsafe {
        SendInput(
            inputs.len() as u32,
            inputs.as_mut_ptr(),
            std::mem::size_of::<INPUT>() as i32,
        )
    };
    if num_processed == 0 {
        Err(std::io::Error::last_os_error())
    } else {
        Ok(num_processed as usize)
    }
}
pub fn send_inputs ( inputs : & [ Input ] ) -> Result < usize , std :: io :: Error > { if inputs . is_empty ( ) { return Ok ( 0 ) ; } let mut inputs : Vec < INPUT > = inputs . iter ( ) . map ( Into :: into ) . collect ( ) ; let num_processed = unsafe { SendInput ( inputs . len ( ) as u32 , inputs . as_mut_ptr ( ) , std :: mem :: size_of :: < INPUT > ( ) as i32 , ) } ; if num_processed == 0 { Err ( std :: io :: Error :: last_os_error ( ) ) } else { Ok ( num_processed as usize ) } }
Send mouse, keyboard, and hardware inputs
Send mouse keyboard and hardware inputs
inputs
&[Input]
inputs
&[Input]