Rather than greatly complicating the user interface (and code) for defining

custom keys to include a 'global' section, I've just re-added the P key
in a hard-coded manner. If the P key is pressed, the puzzle isn't already
paused, and the user has not redefined P to perform some other command in
the puzzle, it will pause.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3279 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2004-12-20 23:46:36 +00:00
parent 7afefd747b
commit 19aaa0fa3c
@@ -938,9 +938,15 @@ public abstract class PuzzleController extends GameController
protected KeyListener _globalKeyListener = new KeyAdapter() {
public void keyReleased (KeyEvent e)
{
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
int keycode = e.getKeyCode();
if (keycode == KeyEvent.VK_ESCAPE) {
// toggle pausyness, my pussycat
setChatting(!isChatting());
} else if (keycode == KeyEvent.VK_P && !isChatting() &&
!_panel._xlate.hasCommand(KeyEvent.VK_P)) {
// if they hit the P key while puzzling, pause
setChatting(true);
}
}
};