From cf600083d778d1bb9675bb3fa89df84547f7785c Mon Sep 17 00:00:00 2001 From: "helmut.neemann" Date: Tue, 25 Apr 2017 12:14:32 +0200 Subject: [PATCH] The backspace key works like the del key. --- distribution/ReleaseNotes.txt | 1 + .../de/neemann/digital/gui/components/CircuitComponent.java | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/distribution/ReleaseNotes.txt b/distribution/ReleaseNotes.txt index da498cb05..cd11c4bc3 100644 --- a/distribution/ReleaseNotes.txt +++ b/distribution/ReleaseNotes.txt @@ -2,6 +2,7 @@ Release Notes planed as v0.12 - added the possibility to open a circuit from the command line +- The backspace key works like the delete key. v0.11, released on 20. Apr 2017 - Added floating gate FETs. diff --git a/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java b/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java index bd6499c9e..68c28dcf2 100644 --- a/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java +++ b/src/main/java/de/neemann/digital/gui/components/CircuitComponent.java @@ -168,9 +168,10 @@ public class CircuitComponent extends JComponent implements Circuit.ChangedListe } }; - getInputMap().put(KeyStroke.getKeyStroke("ESCAPE"), ESC_ACTION); + getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), ESC_ACTION); getActionMap().put(ESC_ACTION, escapeAction); - getInputMap().put(KeyStroke.getKeyStroke("DELETE"), DEL_ACTION); + getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), DEL_ACTION); + getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), DEL_ACTION); getActionMap().put(DEL_ACTION, deleteAction); getInputMap().put(KeyStroke.getKeyStroke('C', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()), "myCopy"); getActionMap().put("myCopy", copyAction);