Pergunta

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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top