octalmage / robotjs

Node.js Desktop Automation.
http://robotjs.io
MIT License
12.37k stars 961 forks source link

Smaller screen size than actual screen size #588

Open NateTheCarrot opened 4 years ago

NateTheCarrot commented 4 years ago

My actual screen size is 1920x1080, and Windows 10 confirms this in settings. However, RobotJS is claiming that my screen size is 1280x720. I've tried 1280x720 in the Windows settings, and there is a visible difference while also RobotJS then claiming that the screen size is 854x480. When running a loop function to get the mouse coordinates at every possible moment, I get the same results, though I don't see how it would have made any other difference. Just something to keep in mind.

Expected Behavior

RobotJS should display my screen size as 1920 for the x value and 1080 for the y value.

Current Behavior

RobotJS shows a smaller size for the screen, being 1280x720 with 1920x1080 and 854x480 with the actual size 1280x720.

Possible Solution

Possibly check in Windows settings for the screen size, unless that's already done.

Steps to Reproduce (for bugs)

  1. Confirm your actual screen size in settings.
  2. Create a script that gets the screen size with RobotJS.
  3. Run the script.

Context

I am trying to accurately make the cursor draw a circle that is circling the middle of the screen in order to play a specific game. I only discovered this yesterday when attempting to figure out the bounds of what I had to work with and needed more specifics.

Your Environment

summerzzc commented 4 years ago

This should be caused by the zoom in the win10 display settings,RobotJS may have ignored this.