Pergunta

I want to write keyReleased method which can check that Ctrl was released.

How to check that button is Ctrl in keyReleased handler?

Thanks friends!

Foi útil?

Solução

Add KeyListener on the component.

        public void keyReleased(KeyEvent event) {
            if(event.getKeyCode()==KeyEvent.VK_CONTROL){
                // ctrl key is released
            }
        }
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top