I need an implementation of a few keyboard and mouse related methods in Java, which are to handle:
1. A method toggling whether input from keyboard and mouse is forwarded to the OS (i.e., if active this should disable any user induced mouse movement on the local machine), furthermore all keyboard input should be ignored (special keystrokes such as CTRL+ALT+DEL on Windows may be exempt, of course).
2. A listener for mouse movement, this should also work if (1) is toggled on, and only return data relative to the direction of mouse movement.
3. A system-wide keyboard listener, which also should function when (1) is active.
I understand that some of these methods may need JNI to function, and a backing C or C++ implementation is acceptable (if you feel like another language would do a better job, please contact me first).
I understand that Administrator rights may be necessary for this to work, if so is the case please use the graphical authentication facility of the OS to request those permissions.
Preferably implementations would work on Windows, Mac Os X and Linux (Gnome), but I might be willing to drop last one or two. Please state the platforms you would wish to support.
Finally, this really is just for the single class. I need nothing further. Please don't produce anything like invisible windows covering the whole screen (I can do that myself).