diff --git a/app/src/processing/app/SerialMonitor.java b/app/src/processing/app/SerialMonitor.java index 99b8c00b0..ddcc4d792 100644 --- a/app/src/processing/app/SerialMonitor.java +++ b/app/src/processing/app/SerialMonitor.java @@ -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()); diff --git a/todo.txt b/todo.txt index 7ece71ef3..e0f125c09 100644 --- a/todo.txt +++ b/todo.txt @@ -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.