summaryrefslogtreecommitdiff
path: root/src/eventsmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-11 18:07:18 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-11 18:07:18 +0300
commitae63537b71186b08dfac9604be901032bcf7f190 (patch)
treede486773bf60fd0be2f3b2f05891a3a11920525d /src/eventsmanager.cpp
parentbdbb68730bf78a307f50edd1dcb6244db0455659 (diff)
downloadmv-ae63537b71186b08dfac9604be901032bcf7f190.tar.gz
mv-ae63537b71186b08dfac9604be901032bcf7f190.tar.bz2
mv-ae63537b71186b08dfac9604be901032bcf7f190.tar.xz
mv-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.cpp8
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: