From 5ddd3a6d40825bca172790c8d216162049bbb09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 26 May 2019 18:56:51 +0200 Subject: [PATCH] Platform: test also key release events in EmscriptenApplication. --- .../Platform/Test/EmscriptenApplicationTest.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp b/src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp index 42ceb6968..9cc164460 100644 --- a/src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp +++ b/src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp @@ -86,6 +86,19 @@ struct EmscriptenApplicationTest: Platform::Application { if(event.modifiers() & KeyEvent::Modifier::Alt) Debug{} << "Alt"; if(event.modifiers() & KeyEvent::Modifier::Super) Debug{} << "Super"; } + + void keyReleaseEvent(KeyEvent& event) override { + if(event.key() != KeyEvent::Key::Unknown) { + Debug{} << "keyReleaseEvent(" << event.keyName().c_str() << "): ✓"; + } else { + Debug{} << "keyReleaseEvent(" << event.keyName().c_str() << "): x"; + } + + if(event.modifiers() & KeyEvent::Modifier::Shift) Debug{} << "Shift"; + if(event.modifiers() & KeyEvent::Modifier::Ctrl) Debug{} << "Ctrl"; + if(event.modifiers() & KeyEvent::Modifier::Alt) Debug{} << "Alt"; + if(event.modifiers() & KeyEvent::Modifier::Super) Debug{} << "Super"; + } }; }}}