1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01: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

@ -46,6 +46,15 @@ public class SerialMonitor extends JFrame implements MessageConsumer {
closeSerialPort();
}
});
// 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());

View File

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