off by 1 error with number keys in ghost/sdl
authorCampbell Barton <ideasman42@gmail.com>
Tue, 9 Aug 2011 07:09:49 +0000 (07:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 9 Aug 2011 07:09:49 +0000 (07:09 +0000)
intern/ghost/intern/GHOST_SystemSDL.cpp

index cd7efba592b469c74c990ec16ac650f6390af8e7..aebb94d5cdf169008ea99d7312fdd63a7a2f62b7 100644 (file)
@@ -146,7 +146,7 @@ convertSDLKey(SDL_Scancode key)
        if ((key >= SDL_SCANCODE_A) && (key <= SDL_SCANCODE_Z)) {
                type= GHOST_TKey( key - SDL_SCANCODE_A + int(GHOST_kKeyA));
        } else if ((key >= SDL_SCANCODE_1) && (key <= SDL_SCANCODE_0)) {
-               type= GHOST_TKey(key - SDL_SCANCODE_1 + int(GHOST_kKey0));
+               type= (key == SDL_SCANCODE_0) ? GHOST_kKey0 : GHOST_TKey(key - SDL_SCANCODE_1 + int(GHOST_kKey1));
        } else if ((key >= SDL_SCANCODE_F1) && (key <= SDL_SCANCODE_F12)) {
                type= GHOST_TKey(key - SDL_SCANCODE_F1 + int(GHOST_kKeyF1));
        } else if ((key >= SDL_SCANCODE_F13) && (key <= SDL_SCANCODE_F24)) {