From 12ccc1061b62a4c76f7454b0a125d0841066f0ad Mon Sep 17 00:00:00 2001 From: crusader Date: Wed, 23 Dec 2020 14:39:03 +0900 Subject: [PATCH] debugging --- src/windows/mouse.rs | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/windows/mouse.rs b/src/windows/mouse.rs index ff17503..512c2cf 100644 --- a/src/windows/mouse.rs +++ b/src/windows/mouse.rs @@ -50,25 +50,25 @@ impl Robot { } pub fn mouse_move_to(dx: i32, dy: i32) { - let width = unsafe { GetSystemMetrics(SM_CXVIRTUALSCREEN) }; - let height = unsafe { GetSystemMetrics(SM_CYVIRTUALSCREEN) }; - if width == 0 || height == 0 { - return; - } - let pressed_left = Self::mouse_pressed(Button::Left); - let pressed_right = Self::mouse_pressed(Button::Right); - let pressed_middle = Self::mouse_pressed(Button::Middle); - let mut dw_flags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK; + // let width = unsafe { GetSystemMetrics(SM_CXVIRTUALSCREEN) }; + // let height = unsafe { GetSystemMetrics(SM_CYVIRTUALSCREEN) }; + // if width == 0 || height == 0 { + // return; + // } + // let pressed_left = Self::mouse_pressed(Button::Left); + // let pressed_right = Self::mouse_pressed(Button::Right); + // let pressed_middle = Self::mouse_pressed(Button::Middle); + let dw_flags = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_VIRTUALDESK; - if pressed_left { - dw_flags = dw_flags | MOUSEEVENTF_LEFTDOWN; - } - if pressed_right { - dw_flags = dw_flags | MOUSEEVENTF_RIGHTDOWN; - } - if pressed_middle { - dw_flags = dw_flags | MOUSEEVENTF_MIDDLEDOWN; - } + // if pressed_left { + // dw_flags = dw_flags | MOUSEEVENTF_LEFTDOWN; + // } + // if pressed_right { + // dw_flags = dw_flags | MOUSEEVENTF_RIGHTDOWN; + // } + // if pressed_middle { + // dw_flags = dw_flags | MOUSEEVENTF_MIDDLEDOWN; + // } Self::mouse_event( (dx - unsafe { GetSystemMetrics(SM_XVIRTUALSCREEN) }) * 65535