]> git.sesse.net Git - pistorm/commitdiff
Adjust keyboard event file path
authorbeeanyew <Bjorn Astrom>
Sun, 6 Dec 2020 12:09:15 +0000 (13:09 +0100)
committerbeeanyew <Bjorn Astrom>
Sun, 6 Dec 2020 12:09:15 +0000 (13:09 +0100)
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

index e8f99615191e9fc2c8e8e81a65f5c8d9a957068f..39648f37d5ced344308a6d744a656ffd1fb186e7 100644 (file)
@@ -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) {