diff --git a/JGE/src/linuxmain.cpp b/JGE/src/linuxmain.cpp index 7d3267a57..8d09c3fbb 100644 --- a/JGE/src/linuxmain.cpp +++ b/JGE/src/linuxmain.cpp @@ -360,7 +360,7 @@ void initGlut(int* argc, char* argv[]) void specialKey(int key, int x __attribute__((unused)), int y __attribute((unused))) { - for (signed int i = sizeof(gGlutKeyCodes)/sizeof(gGlutKeyCodes[0]) - 1; i > 0; --i) + for (signed int i = sizeof(gGlutKeyCodes)/sizeof(gGlutKeyCodes[0]) - 1; i >= 0; --i) if (gGlutKeyCodes[i] == key) { if (false == gThisFrame[i]) @@ -375,7 +375,7 @@ void specialKey(int key, int x __attribute__((unused)), int y __attribute((unuse } void specialUp(int key, int x __attribute__((unused)), int y __attribute((unused))) { - for (signed int i = sizeof(gGlutKeyCodes)/sizeof(gGlutKeyCodes[0]) - 1; i > 0; --i) + for (signed int i = sizeof(gGlutKeyCodes)/sizeof(gGlutKeyCodes[0]) - 1; i >= 0; --i) if (gGlutKeyCodes[i] == key) { gButtons &= ~gPSPKeyMasks[i]; diff --git a/JGE/src/winmain.cpp b/JGE/src/winmain.cpp index 403331c06..783276d5a 100644 --- a/JGE/src/winmain.cpp +++ b/JGE/src/winmain.cpp @@ -583,7 +583,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, // Handle For This Window if ((wParam >= 0) && (wParam <= 255)) // Is Key (wParam) In A Valid Range? { g_keys[wParam] = TRUE; // Set The Selected Key (wParam) To True - for (signed int i = sizeof(gWinKeyCodes)/sizeof(gWinKeyCodes[0]) - 1; i > 0; --i) + for (signed int i = sizeof(gWinKeyCodes)/sizeof(gWinKeyCodes[0]) - 1; i >= 0; --i) if (gWinKeyCodes[i] == wParam) if (false == gThisFrame[i]) {