1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-12-04 14:46:45 -05:00

Add checks for KEY_EXIT: same functionality as pressing CTRL-C

This commit is contained in:
John Zaitseff 2011-07-19 19:22:20 +10:00
parent ccbe7405f8
commit fcffaa5860
5 changed files with 14 additions and 2 deletions

View File

@ -188,6 +188,8 @@ void exchange_stock (void)
case '4': case '4':
case ' ': case ' ':
case KEY_CANCEL:
case KEY_EXIT:
case KEY_CTRL('C'): case KEY_CTRL('C'):
case KEY_CTRL('G'): case KEY_CTRL('G'):
case KEY_CTRL('\\'): case KEY_CTRL('\\'):
@ -309,6 +311,8 @@ void visit_bank (void)
case '2': case '2':
case '3': case '3':
case ' ': case ' ':
case KEY_CANCEL:
case KEY_EXIT:
case KEY_CTRL('C'): case KEY_CTRL('C'):
case KEY_CTRL('G'): case KEY_CTRL('G'):
case KEY_CTRL('\\'): case KEY_CTRL('\\'):
@ -566,6 +570,8 @@ void trade_shares (int num, bool *bid_used)
case '3': case '3':
case '4': case '4':
case ' ': case ' ':
case KEY_CANCEL:
case KEY_EXIT:
case KEY_CTRL('C'): case KEY_CTRL('C'):
case KEY_CTRL('G'): case KEY_CTRL('G'):
case KEY_CTRL('\\'): case KEY_CTRL('\\'):

View File

@ -111,6 +111,7 @@ void init_game (void)
switch (key) { switch (key) {
case KEY_ESC: case KEY_ESC:
case KEY_CANCEL: case KEY_CANCEL:
case KEY_EXIT:
case KEY_CTRL('C'): case KEY_CTRL('C'):
case KEY_CTRL('G'): case KEY_CTRL('G'):
case KEY_CTRL('\\'): case KEY_CTRL('\\'):
@ -159,6 +160,7 @@ void init_game (void)
switch (key) { switch (key) {
case KEY_ESC: case KEY_ESC:
case KEY_CANCEL: case KEY_CANCEL:
case KEY_EXIT:
case KEY_CTRL('C'): case KEY_CTRL('C'):
case KEY_CTRL('G'): case KEY_CTRL('G'):
case KEY_CTRL('\\'): case KEY_CTRL('\\'):

View File

@ -351,6 +351,7 @@ void show_help (void)
case KEY_ESC: case KEY_ESC:
case KEY_CANCEL: case KEY_CANCEL:
case KEY_EXIT:
case KEY_CTRL('C'): case KEY_CTRL('C'):
case KEY_CTRL('G'): case KEY_CTRL('G'):
case KEY_CTRL('\\'): case KEY_CTRL('\\'):

View File

@ -718,9 +718,10 @@ int gettxline (WINDOW *win, char *buf, int bufsize, bool multifield,
break; break;
case KEY_CANCEL: case KEY_CANCEL:
case KEY_EXIT:
case KEY_CTRL('G'): case KEY_CTRL('G'):
// case KEY_CTRL('C'): case KEY_CTRL('C'):
// case KEY_CTRL('\\'): case KEY_CTRL('\\'):
// Cancel entering the string // Cancel entering the string
ret = ERR; ret = ERR;
done = true; done = true;

View File

@ -243,6 +243,7 @@ selection_t get_move (void)
case KEY_ESC: case KEY_ESC:
case KEY_CANCEL: case KEY_CANCEL:
case KEY_EXIT:
case KEY_CTRL('C'): case KEY_CTRL('C'):
case KEY_CTRL('G'): case KEY_CTRL('G'):
case KEY_CTRL('\\'): case KEY_CTRL('\\'):
@ -333,6 +334,7 @@ selection_t get_move (void)
switch (key) { switch (key) {
case KEY_ESC: case KEY_ESC:
case KEY_CANCEL: case KEY_CANCEL:
case KEY_EXIT:
case KEY_CTRL('C'): case KEY_CTRL('C'):
case KEY_CTRL('G'): case KEY_CTRL('G'):
case KEY_CTRL('\\'): case KEY_CTRL('\\'):