Skip to content

Commit 2e9d0b0

Browse files
committed
Bug fix: Use KeyCode not KeyChar when comparing to KeyEvent enums
1 parent dfab894 commit 2e9d0b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/com/modsim/gui/view/ViewUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,14 +401,14 @@ public void keyPressed(KeyEvent e) {
401401
View v = Main.ui.view;
402402

403403
// Cancel tool usage on escape press
404-
if (e.getKeyChar() == KeyEvent.VK_ESCAPE) {
404+
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
405405
if (v.curTool != null) {
406406
v.curTool.cancel();
407407
v.curTool = null;
408408
}
409409
}
410410
// Delete selection
411-
else if (e.getKeyChar() == KeyEvent.VK_DELETE) {
411+
else if (e.getKeyCode() == KeyEvent.VK_DELETE) {
412412
Main.selection.deleteAll();
413413
}
414414
// Pass to tool

0 commit comments

Comments
 (0)