ok = sdlCheckJoyKey(joypad[i]);
ok = sdlCheckJoyKey(motion[i]);
void sdlCheckKeys(){  sdlNumDevices = SDL_NumJoysticks();  if(sdlNumDevices)    sdlDevices = (SDL_Joystick **)calloc(1,sdlNumDevices *                                         sizeof(SDL_Joystick **));  int i;  bool usesJoy = false;    for(i = 0; i < 12; i++) {    int dev = joypad[i] >> 12;    if(dev) {      dev--;      bool ok = false;            if(sdlDevices) {        if(dev < sdlNumDevices) {          if(sdlDevices[dev] == NULL) {            sdlDevices[dev] = SDL_JoystickOpen(dev);          }          ok = sdlCheckJoyKey(joypad[i]);        } else          ok = false;      }            if(!ok)        joypad[i] = defaultJoypad[i];      else        usesJoy = true;    }  }  for(i = 0; i < 4; i++) {    int dev = motion[i] >> 12;    if(dev) {      dev--;      bool ok = false;            if(sdlDevices) {        if(dev < sdlNumDevices) {          if(sdlDevices[dev] == NULL) {            sdlDevices[dev] = SDL_JoystickOpen(dev);          }                    ok = sdlCheckJoyKey(joypad[i]);        } else          ok = false;      }            if(!ok)        motion[i] = defaultMotion[i];      else        usesJoy = true;    }  }  if(usesJoy)    SDL_JoystickEventState(SDL_ENABLE);}