Skip to content

Commit

Permalink
Hotkey: Refine hotkeys about KEY_ESC.
Browse files Browse the repository at this point in the history
`KEY_ESC`: Press `ESC` key, then wait `VKEY_ESC_WAIT_TIME_MS` milliseconds.
`Meta(KEY_ESC)`: Press `ESC` key twice within `VKEY_ESC_WAIT_TIME_MS` milliseconds.

- maple/edit.c: `ve_key()`: Add `Meta(KEY_ESC)` for inputting `ESC`.
- so/mine.c: `playMine()`:
   Change exit hotkey to `Meta(KEY_ESC)`
   Update the help menu
  • Loading branch information
IepIweidieng committed Feb 13, 2020
1 parent 4e5f210 commit 97812e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions maple/edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,7 @@ vedit(

case Ctrl('U'):
case KEY_ESC:
case Meta(KEY_ESC):

ve_char(27);
break;
Expand Down
4 changes: 2 additions & 2 deletions so/mine.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void drawPrompt(void)
move(7, 0);
outs("掃雷 t"); clrtokol();
move(9, 0);
outs("離開 Esc / q"); clrtokol();
outs("離開 ESC-Esc/q"); clrtokol();
}

void drawMapLine(int y, int flShow)
Expand Down Expand Up @@ -299,7 +299,7 @@ void playMine(void)

switch (ch)
{
case KEY_ESC:
case Meta(KEY_ESC):
return;

case KEY_UP:
Expand Down

0 comments on commit 97812e9

Please sign in to comment.