From 7cb49fbb36ea12ee1917115e0a251123bbe002a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 5 Nov 2019 19:42:20 +0100 Subject: [PATCH] Platform: simple test for Sdl2 and GlfwApplication cursors. --- src/Magnum/Platform/Test/GlfwApplicationTest.cpp | 3 +++ src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/Magnum/Platform/Test/GlfwApplicationTest.cpp b/src/Magnum/Platform/Test/GlfwApplicationTest.cpp index 5fd79069c..884606d81 100644 --- a/src/Magnum/Platform/Test/GlfwApplicationTest.cpp +++ b/src/Magnum/Platform/Test/GlfwApplicationTest.cpp @@ -61,6 +61,9 @@ struct GlfwApplicationTest: Platform::Application { } else if(event.key() == KeyEvent::Key::T) { Debug{} << "setting window title"; setWindowTitle("This is a UTF-8 Window Title™!"); + } else if(event.key() == KeyEvent::Key::H) { + Debug{} << "toggling hand cursor"; + setCursor(cursor() == Cursor::Arrow ? Cursor::Hand : Cursor::Arrow); } } diff --git a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp index ec7eb6f39..261336458 100644 --- a/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp +++ b/src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp @@ -86,6 +86,9 @@ struct Sdl2ApplicationTest: Platform::Application { } else if(event.key() == KeyEvent::Key::T) { Debug{} << "setting window title"; setWindowTitle("This is a UTF-8 Window Title™!"); + } else if(event.key() == KeyEvent::Key::H) { + Debug{} << "toggling hand cursor"; + setCursor(cursor() == Cursor::Arrow ? Cursor::Hand : Cursor::Arrow); } #ifdef CORRADE_TARGET_EMSCRIPTEN else if(event.key() == KeyEvent::Key::F) {