pub fn press_key(&self, key: usize) -> io::Result<()> {
        unsafe {
            if !PostMessageW(self.hwnd, MessageType::KeyDown as u32, key, 0) {
                // PostMessageW() failed
                return Err(io::Error::last_os_error());
            }

            if !PostMessageW(self.hwnd, MessageType::KeyUp as u32, key,
                    3 << 30) {
                // PostMessageW() failed
                return Err(io::Error::last_os_error());
            }
        }
        
        Ok(())
    }
/// Presses a key down and releases it
Presses a key down and releases it
Presses a key down and releases it
pub fn press_key(&self, key: usize) -> io::Result<()> {
        unsafe {
            if !PostMessageW(self.hwnd, MessageType::KeyDown as u32, key, 0) {
                // PostMessageW() failed
                return Err(io::Error::last_os_error());
            }
            if !PostMessageW(self.hwnd, MessageType::KeyUp as u32, key,
                    3 << 30) {
                // PostMessageW() failed
                return Err(io::Error::last_os_error());
            }
        }
        Ok(())
    }
pub fn press_key ( & self , key : usize ) -> io :: Result < ( ) > { unsafe { if ! PostMessageW ( self . hwnd , MessageType :: KeyDown as u32 , key , 0 ) { // PostMessageW() failed return Err ( io :: Error :: last_os_error ( ) ) ; } if ! PostMessageW ( self . hwnd , MessageType :: KeyUp as u32 , key , 3 << 30 ) { // PostMessageW() failed return Err ( io :: Error :: last_os_error ( ) ) ; } } Ok ( ( ) ) }
Presses a key down and releases it
Presses a key down and releases it
&self
key
usize
&self
key
usize