1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-11-03 17:27:29 -05:00

Add more control keys handled by various input routines for consistency

This commit is contained in:
John Zaitseff 2011-07-16 13:32:02 +10:00
parent ac6e432c18
commit 6c708d6f83

View File

@ -108,9 +108,18 @@ void init_game (void)
key = toupper(gettxchar(curwin)); key = toupper(gettxchar(curwin));
done = ((key >= '1') && (key <= (MAX_PLAYERS + '0'))) || (key == 'C'); done = ((key >= '1') && (key <= (MAX_PLAYERS + '0'))) || (key == 'C');
if ((key == KEY_ESC) || (key == KEY_CTRL('C')) || (key == KEY_CTRL('\\'))) { switch (key) {
case KEY_ESC:
case KEY_CANCEL:
case KEY_CTRL('C'):
case KEY_CTRL('G'):
case KEY_CTRL('\\'):
abort_game = true; abort_game = true;
return; return;
default:
// Do nothing
break;
} }
if (! done) { if (! done) {
@ -144,8 +153,23 @@ void init_game (void)
wrefresh(curwin); wrefresh(curwin);
do { do {
key = toupper(gettxchar(curwin)); key = gettxchar(curwin);
done = ((key >= '1') && (key <= '9')) || (key == KEY_ESC); done = (key >= '1' && key <= '9');
switch (key) {
case KEY_ESC:
case KEY_CANCEL:
case KEY_CTRL('C'):
case KEY_CTRL('G'):
case KEY_CTRL('\\'):
key = KEY_ESC;
done = true;
break;
default:
// Do nothing
break;
}
if (! done) { if (! done) {
beep(); beep();