Skip to content

mouse.move(new Point(x, y)) not working in Windows 11 #498

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

Closed
1 of 3 tasks
maifeeulasad opened this issue Apr 1, 2023 · 1 comment
Closed
1 of 3 tasks

mouse.move(new Point(x, y)) not working in Windows 11 #498

maifeeulasad opened this issue Apr 1, 2023 · 1 comment

Comments

@maifeeulasad
Copy link

I'm trying to move my mouse curor into some top left position, then click on it. And finally try typing something. But it doesn't seem to be moving, although it's clicking and typing for sure

Desired execution environment / tested on

  • Virtual machine
  • Docker container
  • Dev/Host system

Code & More Details

const {
  mouse,
  keyboard,
  sleep,
  Button,
  Point
} = require("@nut-tree/nut-js");
...
async function x(message){
  console.log(await mouse.getPosition())
  await mouse.move(new Point(200, 200));  // <---------- issue here
  await sleep(2000);
  await mouse.click(Button.LEFT);
  await sleep(2000);
  await keyboard.type(message);
}
...
(async () => {
  await x("meaw")
})();

It kept clicking a button, that's how I noticed it was clicking. Then I moved it on top of notepad, and started a program, it was typing, but real slow.

Now the question remains, why can't I move my mouse?

@s1hofmann
Copy link
Member

s1hofmann commented Apr 2, 2023

Hi @maifeeulasad 👋

mouse.move expects an array of points to follow along.

Explicitly setting the cursor position is done via setPosition

I’m considering the edge case of a single point for move, but I’d create a separate ticket for that.

All the best

Simon

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

2 participants