Loosing my input



Hi,

I use a joypad to control my app. This is the init code for it:

void joystarter()
{
      if ((fd = open(name, O_RDONLY)) > 0)
     {
           joytag = gdk_input_add(fd,GDK_INPUT_READ,joystick_callback,NULL);
           ioctl(fd, JSIOCGVERSION, &version);
           ioctl(fd, JSIOCGAXES, &axes);
           ioctl(fd, JSIOCGBUTTONS, &buttons);
           ioctl(fd, JSIOCGNAME(30), name);
     }
}

My app has to start some other programs

switch(kind=fork())
{
      case -1 :  printf("Fehler bei fork()..........\n");  break;
      case  0 :  system(temp); wait(NULL);  printf("zu ende \n"); break;
}

with own joystick support. After closing this second program, I didn't get
any input from the joystick anymore.
Could anyone help me with this problem?

Thanks
Markus





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]