Detecting a Mouse Click Anywhere on Screen with Java
问题 Is it possible to detect a mouse click anywhere on a screen, outside of my application? I have written an application to do this in C#, but would like to write a version of this in Java so that it can be run on several platforms. It looks like I can get the co-ordinates of the mouse at any time with java.awt.MouseInfo.getPointerInfo() but I am not sure as to how to listen for a mouse click. In C# I used GetAsyncKeyState to detect whether the mouse button was clicked, but obviously I cannot