for(i = 0 ; i < 12; i++) { if((joypad[i] & 0xf000) == 0) { if(key == joypad[i]) sdlButtons[i] = down;
for(int j = 0; j < 4; j++) { for(i = 0 ; i < 12; i++) { if((joypad[j][i] & 0xf000) == 0) { if(key == joypad[j][i]) sdlButtons[j][i] = down; }
void sdlUpdateKey(int key, bool down){  int i;  for(i = 0 ; i < 12; i++) {    if((joypad[i] & 0xf000) == 0) {      if(key == joypad[i])        sdlButtons[i] = down;    }  }  for(i = 0 ; i < 4; i++) {    if((motion[i] & 0xf000) == 0) {      if(key == motion[i])        sdlMotionButtons[i] = down;    }  }}