summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-09-08 21:14:40 +0300
committerAndrei Karas <akaras@inbox.ru>2017-09-08 21:14:40 +0300
commit13f1cb248d227d25901ed222109b552e2068b073 (patch)
treef4f59c5b14502b6e13570eab462a93145e602421
parent49a7a62cae6ff0e5d1441f5800250b0e273800fa (diff)
downloadplus-13f1cb248d227d25901ed222109b552e2068b073.tar.gz
plus-13f1cb248d227d25901ed222109b552e2068b073.tar.bz2
plus-13f1cb248d227d25901ed222109b552e2068b073.tar.xz
plus-13f1cb248d227d25901ed222109b552e2068b073.zip
Extend input events logging with SDL2.
-rw-r--r--src/eventsmanager.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp
index efd300f9c..36c6e2d23 100644
--- a/src/eventsmanager.cpp
+++ b/src/eventsmanager.cpp
@@ -311,8 +311,15 @@ void EventsManager::logEvent(const SDL_Event &event)
winEventLog(SDL_WINDOWEVENT_FOCUS_LOST,
"SDL_WINDOWEVENT_FOCUS_LOST");
winEventLog(SDL_WINDOWEVENT_CLOSE, "SDL_WINDOWEVENT_CLOSE");
+#if SDL_VERSION_ATLEAST(2, 0, 5)
+ winEventLog(SDL_WINDOWEVENT_TAKE_FOCUS,
+ "SDL_WINDOWEVENT_TAKE_FOCUS");
+ winEventLog(SDL_WINDOWEVENT_HIT_TEST,
+ "SDL_WINDOWEVENT_HIT_TEST");
+#endif // SDL_VERSION_ATLEAST(2, 0, 5)
default:
- str = "unknown";
+ str = strprintf("unknown: %d",
+ event.window.event);
break;
}
logger->log("event: SDL_WINDOWEVENT: %s: %d,%d",
@@ -346,6 +353,25 @@ void EventsManager::logEvent(const SDL_Event &event)
case SDL_APP_DIDENTERBACKGROUND:
logger->log("SDL_APP_DIDENTERBACKGROUND");
break;
+ case SDL_MOUSEWHEEL:
+ logger->log("event: SDL_MOUSEWHEEL: %u,%u, %d,%d, %u",
+ event.wheel.windowID,
+ event.wheel.which,
+ event.wheel.x,
+ event.wheel.y,
+ event.wheel.direction);
+ break;
+#if SDL_VERSION_ATLEAST(2, 0, 4)
+ case SDL_AUDIODEVICEADDED:
+ logger->log("event: SDL_AUDIODEVICEADDED: %u,%u",
+ event.adevice.which,
+ event.adevice.iscapture);
+ break;
+ case SDL_KEYMAPCHANGED:
+ logger->log("event: SDL_KEYMAPCHANGED");
+ break;
+#endif // SDL_VERSION_ATLEAST(2, 0, 4)
+
#else // USE_SDL2
case SDL_MOUSEMOTION:
@@ -423,7 +449,7 @@ void EventsManager::logEvent(const SDL_Event &event)
#endif // ANDROID
default:
- logger->log("event: other: %u", event.type);
+ logger->assertLog("event: other: %u", event.type);
break;
};
}