Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollMouse(x, y) is not working in Windows 10 #663

Open
akanshSirohi opened this issue Apr 27, 2021 · 4 comments
Open

scrollMouse(x, y) is not working in Windows 10 #663

akanshSirohi opened this issue Apr 27, 2021 · 4 comments

Comments

@akanshSirohi
Copy link

akanshSirohi commented Apr 27, 2021

Expected Behavior

robot.scrollMouse(0, 100); // It should scroll the screen upwards

Current Behavior

robot.scrollMouse(0, 100); // Doing nothing...

Steps to Reproduce (for bugs)

  1. Rebuilt RobotJS for ElectronJS with the following command npm rebuild --runtime=electron --target=12.0.4 --disturl=https://atom.io/download/atom-shell --abi=48
  2. Run
const robot = require("robotjs");
robot.scrollMouse(0, 100);

Context

Using RobotJS in desktop automation application built in ElectronJS

Your Environment

  • RobotJS version: 0.6.0
  • Node.js version: 14.7.0
  • npm version: 6.14.7
  • Operating System: Windows 10
@zhangshaoju1987
Copy link

you should focus first. eg. moveMouse to target and then troggleMouse down ,and final do scrollMouse

@akanshSirohi
Copy link
Author

I found the working solution for this, and this is successfully tested on Windows 10.
Make the following changes in file mouse.c.
On line 335 replace

mouseScrollInputs[0].mi.mouseData = y;

with

mouseScrollInputs[0].mi.mouseData = -x;

And on line 344 replace

mouseScrollInputs[1].mi.mouseData = -x;

with

mouseScrollInputs[1].mi.mouseData = y;

@AkasaHakase
Copy link

实际上在今天scrollMouse在win上面没有做什么操作

@akanshSirohi akanshSirohi reopened this Oct 22, 2022
@favour1025
Copy link

favour1025 commented May 6, 2024

I modified the code corresponding to the mouse.c file according to your prompt, but it did not achieve the expected effect.(windows 10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants