From 74fe0f61f38c827b80c90730e9c58067a3fb9612 Mon Sep 17 00:00:00 2001 From: beeanyew Date: Sun, 6 Dec 2020 13:09:15 +0100 Subject: [PATCH] Adjust keyboard event file path Also adds a command line switch --kb-file that lets you specify the path to the file path currently receiving events from the keyboard. --- emulator.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/emulator.c b/emulator.c index e8f9961..39648f3 100644 --- a/emulator.c +++ b/emulator.c @@ -99,7 +99,7 @@ void *gpclk_map; unsigned int cpu_type = M68K_CPU_TYPE_68000; unsigned int loop_cycles = 300; struct emulator_config *cfg = NULL; -char keyboard_file[256] = "/dev/input/event1"; +char keyboard_file[256] = "/dev/input/event0"; // I/O access volatile unsigned int *gpio; @@ -209,6 +209,14 @@ int main(int argc, char *argv[]) { cfg = load_config_file(argv[g]); } } + else if (strcmp(argv[g], "--keyboard-file") == 0 || strcmp(argv[g], "--kbfile") == 0) { + if (g + 1 >= argc) { + printf("%s switch found, but no keyboard device path specified.\n", argv[g]); + } else { + g++; + strcpy(keyboard_file, argv[g]); + } + } } if (!cfg) { -- 2.39.2