pub fn left_click(&self, state: Option<KeyMouseState>) -> io::Result<()> {
        // Get the state, or create a new, empty state
        let mut state = state.unwrap_or_default();

        unsafe {
            state.left_mouse = true;
            if !PostMessageW(self.hwnd, MessageType::LButtonDown as u32,
                    state.into(), 0) {
                // PostMessageW() failed
                return Err(io::Error::last_os_error());
            }

            state.left_mouse = false;
            if !PostMessageW(self.hwnd, MessageType::LButtonUp as u32,
                    state.into(), 0) {
                // PostMessageW() failed
                return Err(io::Error::last_os_error());
            }
        }

        Ok(())
    }
/// Does a left click of the current window
Does a left click of the current window
Does a left click of the current window
pub fn left_click(&self, state: Option<KeyMouseState>) -> io::Result<()> {
        // Get the state, or create a new, empty state
        let mut state = state.unwrap_or_default();
        unsafe {
            state.left_mouse = true;
            if !PostMessageW(self.hwnd, MessageType::LButtonDown as u32,
                    state.into(), 0) {
                // PostMessageW() failed
                return Err(io::Error::last_os_error());
            }
            state.left_mouse = false;
            if !PostMessageW(self.hwnd, MessageType::LButtonUp as u32,
                    state.into(), 0) {
                // PostMessageW() failed
                return Err(io::Error::last_os_error());
            }
        }
        Ok(())
    }
pub fn left_click ( & self , state : Option < KeyMouseState > ) -> io :: Result < ( ) > { // Get the state, or create a new, empty state let mut state = state . unwrap_or_default ( ) ; unsafe { state . left_mouse = true ; if ! PostMessageW ( self . hwnd , MessageType :: LButtonDown as u32 , state . into ( ) , 0 ) { // PostMessageW() failed return Err ( io :: Error :: last_os_error ( ) ) ; } state . left_mouse = false ; if ! PostMessageW ( self . hwnd , MessageType :: LButtonUp as u32 , state . into ( ) , 0 ) { // PostMessageW() failed return Err ( io :: Error :: last_os_error ( ) ) ; } } Ok ( ( ) ) }
Does a left click of the current window
Does a left click of the current window
&self
state
Option<KeyMouseState>
&self
state
Option<KeyMouseState>