mirror of
https://git.zap.org.au/git/trader.git
synced 2024-12-04 14:46:45 -05:00
Add more control keys handled by various input routines for consistency
This commit is contained in:
parent
ac6e432c18
commit
6c708d6f83
30
src/game.c
30
src/game.c
@ -108,9 +108,18 @@ void init_game (void)
|
||||
key = toupper(gettxchar(curwin));
|
||||
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;
|
||||
return;
|
||||
|
||||
default:
|
||||
// Do nothing
|
||||
break;
|
||||
}
|
||||
|
||||
if (! done) {
|
||||
@ -144,8 +153,23 @@ void init_game (void)
|
||||
wrefresh(curwin);
|
||||
|
||||
do {
|
||||
key = toupper(gettxchar(curwin));
|
||||
done = ((key >= '1') && (key <= '9')) || (key == KEY_ESC);
|
||||
key = gettxchar(curwin);
|
||||
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) {
|
||||
beep();
|
||||
|
Loading…
Reference in New Issue
Block a user