+ /* init joystick */
+ if (joystick_devname != NULL) {
+ if (joystick_init(joystick_devname, &joyinfo) < 0) {
+ fprintf(stderr, "error in joystick init\n");
+ return -1;
+ }
+ event_set(&joystick_read_event, joyinfo.fd, EV_READ | EV_PERSIST,
+ joystick_input, &joyinfo);
+ event_add(&joystick_read_event, NULL);
+ }
+