From: beeanyew Date: Fri, 4 Dec 2020 07:35:22 +0000 (+0100) Subject: Disable keyboard input for now X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=eaf0b75ba9f4186d815a0b4e85a1fc45dcceb1ee;p=pistorm Disable keyboard input for now Apparently termios performance is terrible. Should probably be in a thread non-blocked by the CPU emulation as well. --- diff --git a/emulator.c b/emulator.c index 23e83b8..dbd4096 100644 --- a/emulator.c +++ b/emulator.c @@ -361,6 +361,7 @@ int main(int argc, char *argv[]) { if (cpu_emulation_running) m68k_execute(loop_cycles); + // FIXME: Rework this to use keyboard events instead. /*while (kbhit()) { char c = getchar(); if (c == cfg->keyboard_toggle_key && !kb_hook_enabled) { diff --git a/input/input.c b/input/input.c index 0a7f53d..b0274e3 100644 --- a/input/input.c +++ b/input/input.c @@ -4,19 +4,7 @@ int kbhit() { - struct termios term; - tcgetattr(0, &term); - - struct termios term2 = term; - term2.c_lflag &= ~ICANON; - tcsetattr(0, TCSANOW, &term2); - - int byteswaiting; - ioctl(0, FIONREAD, &byteswaiting); - - tcsetattr(0, TCSANOW, &term); - - return byteswaiting > 0; + return 0; } extern int mouse_fd;