]> git.sesse.net Git - pistorm/commitdiff
ungrab when quitting emulation
authorjust nine <nine@aphlor.org>
Wed, 14 Apr 2021 21:38:32 +0000 (22:38 +0100)
committerjust nine <nine@aphlor.org>
Wed, 14 Apr 2021 21:38:32 +0000 (22:38 +0100)
emulator.c

index 320c080ccd583f0e4483d65ed5d60a833f2a4d18..06aa179694a839d35aff4cf4cea64845958d8389 100644 (file)
@@ -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;
 }