static void checkKeys()
void DirectInput::checkKeys()
static void checkKeys(){  int dev = 0;  int i;  for(i = 0; i < numDevices; i++)    pDevices[i].needed = 0;  for(i = 0; i < 4; i++) {    dev = joypad[i][KEY_LEFT] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_LEFT] = DIK_LEFT;        dev = joypad[i][KEY_RIGHT] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_RIGHT] = DIK_RIGHT;        dev = joypad[i][KEY_UP] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_UP] = DIK_UP;        dev = joypad[i][KEY_DOWN] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_DOWN] = DIK_DOWN;        dev = joypad[i][KEY_BUTTON_A] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_BUTTON_A] = DIK_Z;        dev = joypad[i][KEY_BUTTON_B] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_BUTTON_B] = DIK_X;        dev = joypad[i][KEY_BUTTON_L] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_BUTTON_L] = DIK_A;        dev = joypad[i][KEY_BUTTON_R] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_BUTTON_R] = DIK_S;        dev = joypad[i][KEY_BUTTON_START] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_BUTTON_START] = DIK_RETURN;        dev = joypad[i][KEY_BUTTON_SELECT] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_BUTTON_SELECT] = DIK_BACK;        dev = joypad[i][KEY_BUTTON_SPEED] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_BUTTON_SPEED] = DIK_SPACE;        dev = joypad[i][KEY_BUTTON_CAPTURE] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_BUTTON_CAPTURE] = DIK_F12;        dev = joypad[i][KEY_BUTTON_GS] >> 8;    if(dev < numDevices && dev >= 0)      pDevices[dev].needed = 1;    else      joypad[i][KEY_BUTTON_GS] = DIK_C;  }      dev = motion[KEY_UP] >> 8;  if(dev < numDevices && dev >= 0)    pDevices[dev].needed = 1;  else    motion[KEY_UP] = DIK_NUMPAD8;    dev = motion[KEY_DOWN] >> 8;  if(dev < numDevices && dev >= 0)    pDevices[dev].needed = 1;  else    motion[KEY_DOWN] = DIK_NUMPAD2;    dev = motion[KEY_LEFT] >> 8;  if(dev < numDevices && dev >= 0)    pDevices[dev].needed = 1;  else    motion[KEY_LEFT] = DIK_NUMPAD4;    dev = motion[KEY_RIGHT] >> 8;  if(dev < numDevices && dev >= 0)    pDevices[dev].needed = 1;  else    motion[KEY_RIGHT] = DIK_NUMPAD6;  }