Krombik / keysender

Node.js Desktop Automation for Windows.
MIT License
82 stars 9 forks source link

`moveTo` is not working on virtual window #12

Closed tuliocastro closed 1 year ago

tuliocastro commented 1 year ago

Hey, I wanna start saying this is a really nice library, I was doing some tests with the virtual window and it seems the moveTo doesn't work as documented. Basically I wanna do an auto click for background windows. The click seems to working perfectly, but it only clicks wherever my mouse is point. It is not really moving and then click. Is it a limitation or it might be an issue?

I was trying with this simple code

import keysender from 'keysender';
const { Hardware, Virtual} = keysender;

const hardware = new Hardware("Notepad");
const virtual = new Virtual("Notepad"); 

await virtual.mouse.moveTo(100,100); // doesnt do anything
await virtual.mouse.click();

Thank you very much, hope to hear from you.

Krombik commented 1 year ago

Some virtual methods can not work in some windows, it mationed in readme https://github.com/Krombik/keysender#hardware-or-virtual (see Note section)

Krombik commented 1 year ago

You can try to find window children, which receive mouse move messages