سؤال

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!

هل كانت مفيدة؟

المحلول

Add KeyListener on the component.

        public void keyReleased(KeyEvent event) {
            if(event.getKeyCode()==KeyEvent.VK_CONTROL){
                // ctrl key is released
            }
        }
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top