tLayout(new GridLayout(1, screens.length)) įor (int screenNum=0 screenNum < screens. tDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE) JFrame roboTestFrm = new JFrame("Robot Test") GraphicsDevice screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices() Passing the current mouse screen location to Robot.mouseMove causes the cursor to move dramatically. Passing the current mouse screen location to Robot.mouseMove should not cause the cursor to move at all. Clicking on either panel while the window is located on the right screen causes the cursor to be moved to the far right edge of the right monitor. It seems like Robot is using a different coordinate system than everything else. When the mouse is on Screen 2, sampling the mouse location (either via MouseInfo or via an event listener) and feeding the position to Robot.mouseMove causes the cursor to move to a totally different location. GitHub - KarimaBak/LSL-Mouse: Java program to. ![]() You can force the DPI mode to "Unaware" by setting the scaling mode to "System" in "Change DPI Settings" in the "Compatibility" tab of the windows properties dialog for java.exe (we must do this for our app to avoid more severe bugs that occur in "DPI Aware" mode) Java program to broadcast mouse position in a circular steering task using LabStreamingLayer technology. ![]() It does *not* occur when java.exe is running in "DPI Aware" mode. java.exe must be launched in "DPI Unaware" mode to trigger this bug. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : ![]() The problem occurs regardless of which GraphicsDevice is passed into the Robot constructor. It seems to be using a different coordinate system than the other swing/awt methods that deal with mouse position. Using () to move the cursor to a location on a secondary monitor with a different scale factor than the primary monitor does not work correctly.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |