diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-09-11 18:07:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-09-11 18:07:18 +0300 |
commit | ae63537b71186b08dfac9604be901032bcf7f190 (patch) | |
tree | de486773bf60fd0be2f3b2f05891a3a11920525d /src/eventsmanager.cpp | |
parent | bdbb68730bf78a307f50edd1dcb6244db0455659 (diff) | |
download | manaverse-ae63537b71186b08dfac9604be901032bcf7f190.tar.gz manaverse-ae63537b71186b08dfac9604be901032bcf7f190.tar.bz2 manaverse-ae63537b71186b08dfac9604be901032bcf7f190.tar.xz manaverse-ae63537b71186b08dfac9604be901032bcf7f190.zip |
Show key names in input event logger in key up/down events in SDL 2.
Diffstat (limited to 'src/eventsmanager.cpp')
-rw-r--r-- | src/eventsmanager.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp index 143937fe1..f7ac7161e 100644 --- a/src/eventsmanager.cpp +++ b/src/eventsmanager.cpp @@ -287,11 +287,15 @@ void EventsManager::logEvent(const SDL_Event &event) break; } case SDL_KEYDOWN: - logger->log("event: SDL_KEYDOWN: %d,%d", event.key.state, + logger->log("event: SDL_KEYDOWN: %s(%d),%d", + SDL_GetScancodeName(event.key.keysym.scancode), + event.key.state, event.key.keysym.scancode); break; case SDL_KEYUP: - logger->log("event: SDL_KEYUP: %d,%d", event.key.state, + logger->log("event: SDL_KEYUP: %s(%d),%d", + SDL_GetScancodeName(event.key.keysym.scancode), + event.key.state, event.key.keysym.scancode); break; case SDL_WINDOWEVENT: |