Question

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!

Était-ce utile?

La solution

Add KeyListener on the component.

        public void keyReleased(KeyEvent event) {
            if(event.getKeyCode()==KeyEvent.VK_CONTROL){
                // ctrl key is released
            }
        }
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top