From b51f40475dcdf4282eccd3aba9e4e5db034e412f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 15 Sep 2017 04:18:54 +0300 Subject: Improve input logging in SDL 1.2 --- src/eventsmanager.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp index 5bc9035f4..41f2a8f3e 100644 --- a/src/eventsmanager.cpp +++ b/src/eventsmanager.cpp @@ -441,12 +441,20 @@ void EventsManager::logEvent(const SDL_Event &event) event.motion.state, event.motion.x, event.motion.y); break; case SDL_KEYDOWN: - logger->log("event: SDL_KEYDOWN: %d,%d,%d", event.key.state, - event.key.keysym.scancode, event.key.keysym.unicode); + logger->log("event: SDL_KEYDOWN: %s(%d),%d,%d,%d", + SDL_GetKeyName(event.key.keysym.sym), + event.key.keysym.sym, + event.key.keysym.scancode, + event.key.state, + event.key.keysym.unicode); break; case SDL_KEYUP: - logger->log("event: SDL_KEYUP: %d,%d,%d", event.key.state, - event.key.keysym.scancode, event.key.keysym.unicode); + logger->log("event: SDL_KEYUP: %s(%d),%d,%d,%d", + SDL_GetKeyName(event.key.keysym.sym), + event.key.keysym.sym, + event.key.keysym.scancode, + event.key.state, + event.key.keysym.unicode); break; case SDL_VIDEORESIZE: logger->log("event: SDL_VIDEORESIZE"); -- cgit v1.2.3-70-g09d2