// printf("CPU emulation reset.\n");
}
-
if (mouse_hook_enabled && (mouse_extra != 0x00)) {
// mouse wheel events have occurred; unlike l/m/r buttons, these are queued as keypresses, so add to end of buffer
switch (mouse_extra) {
goto cpu_loop;
-//stop_cpu_emulation:
+stop_cpu_emulation:
printf("[CPU] End of CPU thread\n");
}
}
if (c == 'q') {
printf("Quitting and exiting emulator.\n");
- end_signal = 1;
+ end_signal = 1;
+ goto key_end;
}
if (c == 'd') {
realtime_disassembly ^= 1;
key_end:
printf("[KBD] Keyboard thread ending\n");
+ if (cfg->keyboard_grab) {
+ printf(ungrab_message);
+ release_device(keyboard_fd);
+ }
return (void*)NULL;
}
printf("Failed to open keyboard event source.\n");
}
+ if (cfg->mouse_autoconnect)
+ mouse_hook_enabled = 1;
+
+ if (cfg->keyboard_autoconnect)
+ kb_hook_enabled = 1;
+
InitGayle();
signal(SIGINT, sigint_handler);