From 733d417feb44d41eb0800def541065f396ef4d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 5 Jun 2019 09:57:14 +0200 Subject: [PATCH] Platform: testing for wheel events. --- .../Platform/Test/EmscriptenApplicationTest.cpp | 12 +++++++----- src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp | 14 +++++++++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp b/src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp index fa693113f..cbde9e09c 100644 --- a/src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp +++ b/src/Magnum/Platform/Test/EmscriptenApplicationTest.cpp @@ -72,17 +72,19 @@ struct EmscriptenApplicationTest: Platform::Application { /* For testing event coordinates */ void mousePressEvent(MouseEvent& event) override { - Debug{} << "press" << event.position() << Int(event.button()); + Debug{} << "mouse press event:" << event.position() << Int(event.button()); } - /* For testing event coordinates */ void mouseReleaseEvent(MouseEvent& event) override { - Debug{} << "release" << event.position() << Int(event.button()); + Debug{} << "mouse release event:" << event.position() << Int(event.button()); } - /* For testing event coordinates */ void mouseMoveEvent(MouseMoveEvent& event) override { - Debug{} << "move" << event.position(); + Debug{} << "mouse move event:" << event.position() << Int(event.buttons()); + } + + void mouseScrollEvent(MouseScrollEvent& event) override { + Debug{} << "mouse scroll event:" << event.offset() << event.position(); } /* For testing keyboard capture */ diff --git a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp index b457ebf32..14f9203e8 100644 --- a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp +++ b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp @@ -55,7 +55,19 @@ struct Sdl2ApplicationTest: Platform::Application { /* For testing event coordinates */ void mousePressEvent(MouseEvent& event) override { - Debug{} << "mouse press event:" << event.position(); + Debug{} << "mouse press event:" << event.position() << Int(event.button()); + } + + void mouseReleaseEvent(MouseEvent& event) override { + Debug{} << "mouse release event:" << event.position() << Int(event.button()); + } + + void mouseMoveEvent(MouseMoveEvent& event) override { + Debug{} << "mouse move event:" << event.position() << Uint32(event.buttons()); + } + + void mouseScrollEvent(MouseScrollEvent& event) override { + Debug{} << "mouse scroll event:" << event.offset() << event.position(); } void keyPressEvent(KeyEvent& event) override {