Skip to content

Commit

Permalink
but don't run that part on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Cattlesquat committed Oct 15, 2023
1 parent 66778bd commit 5856e69
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import VASSAL.tools.icon.IconFamily;
import VASSAL.tools.swing.SwingUtils;
import net.miginfocom.swing.MigLayout;
import org.apache.commons.lang3.SystemUtils;

import javax.swing.JButton;
import javax.swing.JComponent;
Expand Down Expand Up @@ -425,12 +426,14 @@ public void keyReleased(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_DELETE:
case KeyEvent.VK_BACK_SPACE:
// Allow mapping of Delete
if (getValue().equals(NamedKeyStroke.NULL_KEYSTROKE) || e.isShiftDown() || e.isControlDown() || e.isMetaDown() || e.isAltDown()) {
setValue(NamedKeyStroke.of(SwingUtils.convertKeyEvent(e)));
}
else {
setValue(NamedKeyStroke.NULL_KEYSTROKE);
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)));
}
else {
setValue(NamedKeyStroke.NULL_KEYSTROKE);
}
}
break;
case KeyEvent.VK_SHIFT:
Expand Down

0 comments on commit 5856e69

Please sign in to comment.