Java Robot MousePress() not working on Windows Task Manager
<p><strong>Problem:</strong></p>

<p>Java Robot's MousePress() works fine 99% of the time, but it does not work on the Task Manager of Windows 8.1 or 10 (I have not tested 7 or lower).</p>

<p>As a matter of fact, when the Task Manager window is selected, even MouseMove() will fail.
<br>
<br></p>

<p><strong>To replicate:</strong></p>

<ol>
<li>Use the code below, run it once to see that the code works.</li>
<li>Open Task Manager (CTRL+Shift+Escape), run the code, then quickly
select the Task Manager window. The code will finish executing, but the mouse position will not change.
<br>
<br></li>
</ol>

<p><strong>Code:</strong></p>

<pre><code>import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.MouseEvent;

public class RobotMousePressTest {

    public static void main(String[] args) throws AWTException, InterruptedException {
        System.out.println("Started. Waiting for sleep to finish.");
        Robot r = new Robot();
        Thread.sleep(3000);
        r.mouseMove(4, 4);
        r.mousePress(MouseEvent.getMaskForButton(MouseEvent.BUTTON1));
        System.out.println("Click!");
    }
}
</code></pre>

<p><br>
<strong>Questions:</strong></p>

<ol>
<li>Does anyone know if there is a way to make it work anyway?</li>
<li>Is there an alternative library I can use for MousePress() and MouseMove()?</li>
<li>Will I be forced to use native code (JNI) in order to get it to work properly?</li>
</ol>