esc is back

This commit is contained in:
Radek Davidek 2026-01-15 11:54:40 +01:00
parent b4226db038
commit 8ac12e30a8

View File

@ -554,6 +554,18 @@ public class MainWindow extends JFrame {
}, KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.CTRL_DOWN_MASK), }, KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.CTRL_DOWN_MASK),
JComponent.WHEN_IN_FOCUSED_WINDOW); JComponent.WHEN_IN_FOCUSED_WINDOW);
// ESC - global escape to return focus to panels
rootPane.registerKeyboardAction(e -> {
if (activePanel != null) {
// If it's the command line, clear it too (though it has its own listener)
if (commandLine.hasFocus()) {
commandLine.setText("");
}
activePanel.getFileTable().requestFocusInWindow();
}
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
JComponent.WHEN_IN_FOCUSED_WINDOW);
// Delete key - global delete binding (also added per-table) // Delete key - global delete binding (also added per-table)
rootPane.registerKeyboardAction(e -> deleteFiles(), rootPane.registerKeyboardAction(e -> deleteFiles(),
KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0),