kernels,typing-game: exit when pressing ESC

This commit is contained in:
Zihao Yu 2020-09-02 20:49:31 +08:00
parent fa054f1c3a
commit 9e59fd2cba

View file

@ -159,6 +159,7 @@ int main() {
while (1) {
AM_INPUT_KEYBRD_T ev = io_read(AM_INPUT_KEYBRD);
if (ev.keycode == AM_KEY_NONE) break;
if (ev.keydown && ev.keycode == AM_KEY_ESCAPE) halt(0);
if (ev.keydown && lut[ev.keycode]) {
check_hit(lut[ev.keycode]);
}