Absolutely not. Java has not direct access to hardware, KeyEvent
s will work if and only if the component on which you apply the KeyListener
is focused. If you want to disable the keyboard you have to use JNI/JNA/any other native interface.
However, this:
Keyevent ke;
ke.consume();
won't work, as ke
is not initialized