I'm using Windows 10 on a Dell Inspiron 13 5000, a 13 inch laptop that has 1920 * 1080 pixels, using the laptop screen. Code:
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Robot robot = new Robot();
robot.mouseMove(screenSize.getWidth() / 2, screenSize.getHeight() / 2);
//screenSize.getWidth() = 1920, getHeight() = 1080
But this doesn't move the mouse to the middle of the screen, it moves it further than the middle. Also when I go to https://www.whatismyscreenresolution.com/ it says my resolution is 1280 * 720. In settings however it says my resolution is 1920 * 1080. I want to run a program that is based on a 1920 * 1080 resolution. Why is this happening? I also tried this but it moves the pointer to less than the middle:
robot.mouseMove(screensize.getWidth() / 2 * 1280 / 1920, screensize.getHeight() / 2 * 720 / 1080);
Is this a computer manufacturer problem? I turned screen scaling to 100% and screenSize.getWidth() = 2880, screenSize.getHeight() = 1620 which is weird.