From: just nine Date: Wed, 14 Apr 2021 21:38:32 +0000 (+0100) Subject: ungrab when quitting emulation X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a118265cb81c2f56105ce0b0569acd27ef09959e;p=pistorm ungrab when quitting emulation --- diff --git a/emulator.c b/emulator.c index 320c080..06aa179 100644 --- a/emulator.c +++ b/emulator.c @@ -350,7 +350,8 @@ key_loop: } if (c == 'q') { printf("Quitting and exiting emulator.\n"); - end_signal = 1; + end_signal = 1; + goto key_end; } if (c == 'd') { realtime_disassembly ^= 1; @@ -379,6 +380,10 @@ key_loop: key_end: printf("[KBD] Keyboard thread ending\n"); + if (cfg->keyboard_grab) { + printf(ungrab_message); + release_device(keyboard_fd); + } return (void*)NULL; }