]> git.sesse.net Git - pistorm/blobdiff - emulator.c
Add keyboard event source file setting to config-file
[pistorm] / emulator.c
index 214d310e7c728e1bb260624249f9fa0536d4a458..167e0141cfc56d8fda426489c6d7b36b3765a8d7 100644 (file)
@@ -458,7 +458,11 @@ int main(int argc, char *argv[]) {
     }
   }
 
-  keyboard_fd = open(keyboard_file, O_RDONLY | O_NONBLOCK);
+  if (cfg->keyboard_file)
+    keyboard_fd = open(cfg->keyboard_file, O_RDONLY | O_NONBLOCK);
+  else
+    keyboard_fd = open(keyboard_file, O_RDONLY | O_NONBLOCK);
+
   if (keyboard_fd == -1) {
     printf("Failed to open keyboard event source.\n");
   }