- if(!(sb = sball_open(argv[1] ? argv[1] : DEFDEV))) {
- fprintf(stderr, "Failed to open spaceball at %s\n", argv[1] ? argv[1] : DEFDEV);
+ if(argv[1]) {
+ if(strcmp(argv[1], "btest") == 0) {
+ sball_button_test();
+ return 0;
+ }
+ dev = argv[1];
+ }
+
+ if(!(sb = sball_open(dev))) {
+ fprintf(stderr, "Failed to open spaceball at %s\n", dev);