diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-13 12:13:56 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-13 12:13:56 +0200 |
commit | 67897701316d83495aed4baa94e96c9f84b818f8 (patch) | |
tree | c359b956e15b2cd9f9f36fe72b3c3cbe2297cac7 /main/keyboard.cpp | |
parent | 713e473b65963ec6ca1b1eb185c297852fa336ea (diff) |
a
Diffstat (limited to 'main/keyboard.cpp')
-rw-r--r-- | main/keyboard.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/keyboard.cpp b/main/keyboard.cpp index 50bc214a..041af2c8 100644 --- a/main/keyboard.cpp +++ b/main/keyboard.cpp @@ -1,4 +1,6 @@ #include "app.hpp" +#include <Magnum/ImGuiIntegration/Context.hpp> + namespace floormat { void app::do_key(KeyEvent::Key k, KeyEvent::Modifiers m, bool pressed, bool repeated) @@ -32,11 +34,15 @@ app::~app() void app::keyPressEvent(Platform::Sdl2Application::KeyEvent& event) { + if (_imgui.handleKeyPressEvent(event)) + return event.setAccepted(); do_key(event.key(), event.modifiers(), true, event.isRepeated()); } void app::keyReleaseEvent(Platform::Sdl2Application::KeyEvent& event) { + if (_imgui.handleKeyReleaseEvent(event)) + return event.setAccepted(); do_key(event.key(), event.modifiers(), false, false); } |