Browse Source

Platform: test Sdl2App/GlfwApp mouse locking.

pull/388/head
Vladimír Vondruš 7 years ago
parent
commit
01e12ba495
  1. 3
      src/Magnum/Platform/Test/GlfwApplicationTest.cpp
  2. 7
      src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp

3
src/Magnum/Platform/Test/GlfwApplicationTest.cpp

@ -64,6 +64,9 @@ struct GlfwApplicationTest: Platform::Application {
} else if(event.key() == KeyEvent::Key::H) {
Debug{} << "toggling hand cursor";
setCursor(cursor() == Cursor::Arrow ? Cursor::Hand : Cursor::Arrow);
} else if(event.key() == KeyEvent::Key::L) {
Debug{} << "toggling locked mouse";
setCursor(cursor() == Cursor::Arrow ? Cursor::HiddenLocked : Cursor::Arrow);
}
}

7
src/Magnum/Platform/Test/Sdl2ApplicationTest.cpp

@ -90,7 +90,12 @@ struct Sdl2ApplicationTest: Platform::Application {
Debug{} << "toggling hand cursor";
setCursor(cursor() == Cursor::Arrow ? Cursor::Hand : Cursor::Arrow);
}
#ifdef CORRADE_TARGET_EMSCRIPTEN
#ifndef CORRADE_TARGET_EMSCRIPTEN
else if(event.key() == KeyEvent::Key::L) {
Debug{} << "toggling locked mouse";
setCursor(cursor() == Cursor::Arrow ? Cursor::HiddenLocked : Cursor::Arrow);
}
#else
else if(event.key() == KeyEvent::Key::F) {
Debug{} << "toggling fullscreen";
setContainerCssClass((_fullscreen ^= true) ? "fullsize" : "");

Loading…
Cancel
Save