diff --git a/vassal-app/src/main/java/VASSAL/configure/NamedHotKeyConfigurer.java b/vassal-app/src/main/java/VASSAL/configure/NamedHotKeyConfigurer.java index 4e1163eddd..d5e6cadfc3 100644 --- a/vassal-app/src/main/java/VASSAL/configure/NamedHotKeyConfigurer.java +++ b/vassal-app/src/main/java/VASSAL/configure/NamedHotKeyConfigurer.java @@ -418,15 +418,15 @@ public void keyPressed(KeyEvent e) { } // Repeat the Key handling for each Key of interest on release. - // This has no effect on Windows, but caters for the bizarre - // KeyEvent sequences created on MacOS. + // Caters for the bizarre KeyEvent sequences created on MacOS. + // ALSO, it turn sout, makes alphanumeric keys record properly on Windows @Override public void keyReleased(KeyEvent e) { // reportKeyEvent("KEY_RELEASED", e); // NON-NLS - if (SystemUtils.IS_OS_MAC) { - switch (e.getKeyCode()) { - case KeyEvent.VK_DELETE: - case KeyEvent.VK_BACK_SPACE: + switch (e.getKeyCode()) { + case KeyEvent.VK_DELETE: + case KeyEvent.VK_BACK_SPACE: + if (SystemUtils.IS_OS_MAC) { // Allow mapping of Delete if (getValue().equals(NamedKeyStroke.NULL_KEYSTROKE) || e.isShiftDown() || e.isControlDown() || e.isMetaDown() || e.isAltDown()) { setValue(NamedKeyStroke.of(SwingUtils.convertKeyEvent(e))); @@ -434,17 +434,17 @@ public void keyReleased(KeyEvent e) { else { setValue(NamedKeyStroke.NULL_KEYSTROKE); } - break; - case KeyEvent.VK_SHIFT: - case KeyEvent.VK_CONTROL: - case KeyEvent.VK_META: - case KeyEvent.VK_ALT: - case KeyEvent.VK_ALT_GRAPH: - case KeyEvent.VK_UNDEFINED: - break; - default: - setValue(NamedKeyStroke.of(SwingUtils.convertKeyEvent(e))); } + break; + case KeyEvent.VK_SHIFT: + case KeyEvent.VK_CONTROL: + case KeyEvent.VK_META: + case KeyEvent.VK_ALT: + case KeyEvent.VK_ALT_GRAPH: + case KeyEvent.VK_UNDEFINED: + break; + default: + setValue(NamedKeyStroke.of(SwingUtils.convertKeyEvent(e))); } } }