void (KeyEvent e) { int key = e.getKeyCode(); if (key == KeyEvent.VK_ENTER || key == KeyEvent.VK_SPACE || key == KeyEvent.VK_RIGHT) { handleFrameSelection(); ApplicationManager.getApplication().invokeLater(() -> handler.accept(myFramesList.getSelectedFrame())); } }