If i make an invisible thread that will run in an infinite loop and which will consume any key event...

   something like,
   Keyevent ke;
   ke.consume();

if this is done for all keylistener interface methods, keypressed,released,typed. And if an invisible thread has all this code. If its converted to an exe...and exe is run.. Will it cause the psuedo keybord failure effect? Is it practically a potential virus?

有帮助吗?

解决方案

Absolutely not. Java has not direct access to hardware, KeyEvents 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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top