File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 11use enigo:: { Enigo , MouseButton , MouseControllable } ;
2+ #[ cfg( windows) ]
23use winapi:: um:: winuser:: WHEEL_DELTA ;
34use std:: thread;
45use std:: time:: Duration ;
@@ -26,16 +27,28 @@ fn main() {
2627
2728 #[ cfg( not( target_os = "macos" ) ) ]
2829 {
30+ #[ cfg( windows) ]
2931 enigo. mouse_scroll_x ( 2 * WHEEL_DELTA as i32 ) ;
32+ #[ cfg( not( windows) ) ]
33+ enigo. mouse_scroll_x ( 2 ) ;
3034 thread:: sleep ( wait_time) ;
3135
36+ #[ cfg( windows) ]
3237 enigo. mouse_scroll_x ( -2 * WHEEL_DELTA as i32 ) ;
38+ #[ cfg( not( windows) ) ]
39+ enigo. mouse_scroll_x ( -2 ) ;
3340 thread:: sleep ( wait_time) ;
3441
42+ #[ cfg( windows) ]
3543 enigo. mouse_scroll_y ( 2 * WHEEL_DELTA as i32 ) ;
44+ #[ cfg( not( windows) ) ]
45+ enigo. mouse_scroll_y ( 2 ) ;
3646 thread:: sleep ( wait_time) ;
3747
48+ #[ cfg( windows) ]
3849 enigo. mouse_scroll_y ( -2 * WHEEL_DELTA as i32 ) ;
50+ #[ cfg( not( windows) ) ]
51+ enigo. mouse_scroll_y ( -2 ) ;
3952 thread:: sleep ( wait_time) ;
4053 }
4154}
You can’t perform that action at this time.
0 commit comments