diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-23 22:01:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-23 22:01:44 +0300 |
commit | 3c404128c4669a1f4f190e20a89553677717fc50 (patch) | |
tree | 2db4e5031089c800c4e00fd6244e578f44a7c910 /src/input/keyboardconfig.cpp | |
parent | 89b267d6d73bbc59f7c313b8a22b97fbb27f99a8 (diff) | |
download | manaverse-3c404128c4669a1f4f190e20a89553677717fc50.tar.gz manaverse-3c404128c4669a1f4f190e20a89553677717fc50.tar.bz2 manaverse-3c404128c4669a1f4f190e20a89553677717fc50.tar.xz manaverse-3c404128c4669a1f4f190e20a89553677717fc50.zip |
Add missing comments into defines.
Diffstat (limited to 'src/input/keyboardconfig.cpp')
-rw-r--r-- | src/input/keyboardconfig.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
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<SDL_Scancode>(key))); -#else +#else // USE_SDL2 + return SDL_GetKeyName(static_cast<SDLKey>(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) |