1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00

Adding keyboard shortcut (command or ctrl w) for closing the serial monitor window.

This commit is contained in:
David A. Mellis
2009-06-16 20:21:39 +00:00
parent 672ad5648e
commit 250bce0f34
2 changed files with 9 additions and 2 deletions

View File

@ -47,6 +47,15 @@ public class SerialMonitor extends JFrame implements MessageConsumer {
} }
}); });
// obvious, no?
KeyStroke wc = Editor.WINDOW_CLOSE_KEYSTROKE;
getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(wc, "close");
getRootPane().getActionMap().put("close", new AbstractAction() {
public void actionPerformed(ActionEvent e) {
closeSerialPort();
setVisible(false);
}});
getContentPane().setLayout(new BorderLayout()); getContentPane().setLayout(new BorderLayout());
Font font = Theme.getFont("console.font"); Font font = Theme.getFont("console.font");

View File

@ -3,8 +3,6 @@
PROCESSING 5503 SYNC PROCESSING 5503 SYNC
Don't require save before upload.
Add library keyword highlighting. Add library keyword highlighting.
Allow closing of the serial monitor with keyboard short cuts. Allow closing of the serial monitor with keyboard short cuts.