-
Notifications
You must be signed in to change notification settings - Fork 978
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
Get Screen Dimensions #25
Comments
I think I'll create a new method for getting the screen size so it's not slowed down by getting the mouse position. The internal C function I'll try to get this added tonight! |
Sorry, thought I replied to this. I added var robot = require("robotjs");
var screen = robot.getScreenSize();
console.log(screen.width + "x" + screen.height); I released RobotJS v0.1.2 with this function, update and let me know how it works! |
Perfect! Thank you, @octalmage! |
Good day. the function to obtain the screen size in macOS does not operate, the result it shows is 0 in width as in height `var robot = require("robotjs"); // Speed up the mouse. var twoPI = Math.PI * 2.0; for (var x = 0; x < width; x++) { |
I've got the same issue! Does somebody know how to solve this? |
Same issue... any fixes? |
If I use NVM to switch to Node Note: I didn't investigate at which version it started to break, v10.23.1 was just the one I already had in NVM. |
Having screen dimensions would be great for calculating where on the screen the mouse is or should be.
This could be returned as a new call in
screen
or returned with the object fromgetMousePos()
so you would havex
,y
,width
, andheight
parameters.Another possibility is passing into
getMousePos({percent:true})
and have it return 2 percentages rather than a fixed location{ x: 50.44, y: 22.34 }
.
The text was updated successfully, but these errors were encountered: