Frage

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!

War es hilfreich?

Lösung

Add KeyListener on the component.

        public void keyReleased(KeyEvent event) {
            if(event.getKeyCode()==KeyEvent.VK_CONTROL){
                // ctrl key is released
            }
        }
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top