From 3c404128c4669a1f4f190e20a89553677717fc50 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 23 Sep 2016 22:01:44 +0300 Subject: Add missing comments into defines. --- src/input/keyboardconfig.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/input/keyboardconfig.cpp') diff --git a/src/input/keyboardconfig.cpp b/src/input/keyboardconfig.cpp index 888b86724..ecd563656 100644 --- a/src/input/keyboardconfig.cpp +++ b/src/input/keyboardconfig.cpp @@ -63,13 +63,14 @@ int KeyboardConfig::getKeyValueFromEvent(const SDL_Event &event) { #ifdef USE_SDL2 return event.key.keysym.scancode; -#else +#else // USE_SDL2 + if (event.key.keysym.sym) return CAST_S32(event.key.keysym.sym); else if (event.key.keysym.scancode > 1) return -event.key.keysym.scancode; return 0; -#endif +#endif // USE_SDL2 } InputActionT KeyboardConfig::getKeyIndex(const SDL_Event &event, const int grp) @@ -92,9 +93,10 @@ std::string KeyboardConfig::getKeyName(const int key) #ifdef USE_SDL2 return SDL_GetKeyName(SDL_GetKeyFromScancode( static_cast(key))); -#else +#else // USE_SDL2 + return SDL_GetKeyName(static_cast(key)); -#endif +#endif // USE_SDL2 } // TRANSLATORS: long key name, should be short @@ -151,9 +153,10 @@ SDLKey KeyboardConfig::getKeyFromEvent(const SDL_Event &event) { #ifdef USE_SDL2 return event.key.keysym.scancode; -#else +#else // USE_SDL2 + return event.key.keysym.sym; -#endif +#endif // USE_SDL2 } KeysVector *KeyboardConfig::getActionVector(const SDL_Event &event) -- cgit v1.2.3-70-g09d2