As far as I know, there is no way to do this outside of using JNI insome fashion to interact with the operating system directly. Java canonly handle mouse and keyboard events inside a Java UI component (suchas an AWT window).