What is wrong is when I set the variable isleftmousedown to true it will test it twice when it is tested in a while loop because I tested it with a while loop and you can see this below! If it helps you I am using JNativeHook with this project!
public static NativeMousePressed(NativeMouseEvent e) {
isleftmousedown = true;
}
public static NativeMouseReleased(NativeMouseEvent e) {
isleftmousedown = false;
}
This is the loop:
while (true) {
try {
Thread.sleep(1);
if (isleftmousedown) {
System.out.println("test");
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}