0

The following code is activated on single key 'F2'. Is it possible the code to be modified for double key combination, e.g. control+F2, shift+f2 or ETC?

KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher(){
@Override
public boolean dispatchKeyEvent(KeyEvent e){
if(e.getKeyCode() == KeyEvent.VK_F2 && e.getID() == KeyEvent.KEY_PRESSED ){
// some actions
return true;
}
else{
return false;
}
}

0 Answers0