diff --git a/examples/minimal/main.cpp b/examples/minimal/main.cpp index 73c53d0..0531ce6 100644 --- a/examples/minimal/main.cpp +++ b/examples/minimal/main.cpp @@ -15,9 +15,9 @@ int main() { sf::Clock deltaClock; while (window.isOpen()) { while (const auto event = window.pollEvent()) { - ImGui::SFML::ProcessEvent(window, event); + ImGui::SFML::ProcessEvent(window, *event); - if (event.is()) { + if (event->is()) { window.close(); } } diff --git a/examples/multiple_windows/main.cpp b/examples/multiple_windows/main.cpp index 590d4ab..1551076 100644 --- a/examples/multiple_windows/main.cpp +++ b/examples/multiple_windows/main.cpp @@ -17,8 +17,8 @@ int main() { while (window.isOpen()) { // Main window event processing while (const auto event = window.pollEvent()) { - ImGui::SFML::ProcessEvent(window, event); - if (event.is()) { + ImGui::SFML::ProcessEvent(window, *event); + if (event->is()) { if (childWindow.isOpen()) { childWindow.close(); } @@ -31,8 +31,8 @@ int main() { // Child window event processing if (childWindow.isOpen()) { while (const auto event = childWindow.pollEvent()) { - ImGui::SFML::ProcessEvent(childWindow, event); - if (event.is()) { + ImGui::SFML::ProcessEvent(childWindow, *event); + if (event->is()) { childWindow.close(); ImGui::SFML::Shutdown(childWindow); } diff --git a/imgui-SFML.cpp b/imgui-SFML.cpp index 19a04f3..3c5bd92 100644 --- a/imgui-SFML.cpp +++ b/imgui-SFML.cpp @@ -321,7 +321,7 @@ void ProcessEvent(const sf::Window& window, const sf::Event& event) { io.AddMouseWheelEvent(mouseWheelScrolled->delta, 0); } } - const auto handleKeyChanged = [&io](const sf::Event::KeyChanged& keyChanged, bool down) { + const auto handleKeyChanged = [&io](const auto& keyChanged, bool down) { const ImGuiKey mod = keycodeToImGuiMod(keyChanged.code); // The modifier booleans are not reliable when it's the modifier // itself that's being pressed. Detect these presses directly.