forked from External/mage
Added F4 hot key for 'End Turn' action
This commit is contained in:
parent
ecfc58b131
commit
7d1bdfb0ce
2 changed files with 12 additions and 22 deletions
|
|
@ -56,10 +56,7 @@ import javax.swing.GroupLayout.Alignment;
|
|||
import javax.swing.LayoutStyle.ComponentPlacement;
|
||||
import javax.swing.border.LineBorder;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ComponentAdapter;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CancellationException;
|
||||
|
|
@ -736,6 +733,17 @@ public class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
});
|
||||
|
||||
int c = JComponent.WHEN_IN_FOCUSED_WINDOW;
|
||||
KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0);
|
||||
|
||||
this.getInputMap(c).put(ks, "PRESS");
|
||||
this.getActionMap().put("PRESS", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent actionEvent) {
|
||||
btnEndTurnActionPerformed(null);
|
||||
}
|
||||
});
|
||||
|
||||
btnSwitchHands.setText("Switch Hands");
|
||||
btnSwitchHands.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue