#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <signal.h>
#include <errno.h>
#include <unistd.h>
{
int fd;
fd_set rdset;
+ const char *dev = DEFDEV;
signal(SIGINT, sighandler);
- 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);
return 1;
}
fd = sball_fd(sb);