Map Ctrl-Shift-Z to Redo.

This is in addition to the existing keystrokes r, ^R and ^Y. I've
become used to Ctrl-Shift-Z in other GUI games, and my fingers keep
getting confused when my own puzzles don't handle it the same way.
This commit is contained in:
Simon Tatham
2017-09-20 16:38:31 +01:00
parent e4d05c36d9
commit d72db91888
5 changed files with 28 additions and 5 deletions

View File

@ -126,7 +126,12 @@ public class PuzzleApplet extends JApplet implements Runtime.CallJavaCB {
}
}
public void keyTyped(KeyEvent e) {
runtimeCall("jcallback_key_event", new int[] {0, 0, e.getKeyChar()});
int key = e.getKeyChar();
if (key == 26 && e.isShiftDown() && e.isControlDown()) {
runtimeCall("jcallback_redo_event", new int[0]);
return;
}
runtimeCall("jcallback_key_event", new int[] {0, 0, key});
}
});
pp.addMouseListener(new MouseAdapter() {