mouse position - Forum

Forum Navigation
You need to log in to create posts and topics.

mouse position

how can I get/set mouse position, like in NeoBook SetMousePos and GetMousePos?

thanks.

@info1

Take a look here ... https://www.w3schools.com/jsref/event_clientx.asp ... to obtain the current position of the mouse pointer.

Setting/Changing the position of the mouse pointer via script can have security implications ... imagine a page you are viewing with buttons labelled Download and Cancel ... and the script is allowed to move over the Download button ... or something even more harmful.

However, you can (via script) set the focus to an appropriate named object.

Peter has reacted to this post.
Peter

Thanks Gaev,

and how can I "transform" JS var to VisualNeo variable? (Sorry I am still a novice user...)

@info1, although not documented there are already two predefined variables (experimental) to get the mouse coordinates:

[NAB.MouseX]
[NAB.MouseY]

As predefined variables are automatically updated every second or so, use the command Refresh to force updating the values, just before you use them.
Although they work in current version, these variables will be fully functional and documented in next version.
Best regards.

Vadim and Peter have reacted to this post.
VadimPeter