开发者

How to programmatically program a "Wheel Scroll" using Ruby on Windows?

开发者 https://www.devze.com 2022-12-09 20:41 出处:网络
Is there a way to program a \"Scroll whee开发者_开发技巧l\" turn on the Windows platform using Ruby?

Is there a way to program a "Scroll whee开发者_开发技巧l" turn on the Windows platform using Ruby?

Kind of similar to programming a click on Windows, or a keyboard key press, but this is to program a scroll wheel turn. thanks.


I'm not familiar with Ruby but I can give some hints.

You can do that with the win32 mouse_event function.

// wheel - scroll down
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, -WHEEL_DELTA, NULL);
// wheel - scroll up
mouse_event(MOUSEEVENTF_WHEEL, 0, 0, WHEEL_DELTA, NULL);

Or you can send the WM_MOUSEWHEEL message to the window.

0

精彩评论

暂无评论...
验证码 换一张
取 消