From 50216faa9e25511d7912b67513dee18c5bbaface Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 20 Sep 2022 20:47:04 +0200 Subject: [PATCH] Platform: print key release events in application tests as well. --- src/Magnum/Platform/Test/GlfwApplicationTest.cpp | 6 ++++++ src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/Magnum/Platform/Test/GlfwApplicationTest.cpp b/src/Magnum/Platform/Test/GlfwApplicationTest.cpp index d4c3981d4..05788abd8 100644 --- a/src/Magnum/Platform/Test/GlfwApplicationTest.cpp +++ b/src/Magnum/Platform/Test/GlfwApplicationTest.cpp @@ -96,6 +96,12 @@ struct GlfwApplicationTest: Platform::Application { } } + void keyReleaseEvent(KeyEvent& event) override { + #if GLFW_VERSION_MAJOR*100 + GLFW_VERSION_MINOR >= 302 + Debug{} << "key release event:" << int(event.key()) << event.keyName(); + #endif + } + void mouseMoveEvent(MouseMoveEvent& event) override { Debug{} << "mouse move event:" << event.position() << event.relativePosition() << UnsignedInt(event.buttons()); } diff --git a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp index 2adeaf08b..c40683af8 100644 --- a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp +++ b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp @@ -140,6 +140,10 @@ struct Sdl2ApplicationTest: Platform::Application { } } + void keyReleaseEvent(KeyEvent& event) override { + Debug{} << "key release event:" << SDL_Keycode(event.key()) << event.keyName(); + } + void textInputEvent(TextInputEvent& event) override { Debug{} << "text input event:" << event.text(); }