From 19aaa0fa3cbf7f78be796f424b0e39c614e3f801 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Mon, 20 Dec 2004 23:46:36 +0000 Subject: [PATCH] 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 --- .../com/threerings/puzzle/client/PuzzleController.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/puzzle/client/PuzzleController.java b/src/java/com/threerings/puzzle/client/PuzzleController.java index 566cada13..8e4a800ef 100644 --- a/src/java/com/threerings/puzzle/client/PuzzleController.java +++ b/src/java/com/threerings/puzzle/client/PuzzleController.java @@ -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); } } };