diff --git a/Userland/Applications/3DFileViewer/main.cpp b/Userland/Applications/3DFileViewer/main.cpp index e434be23b5..c1c61fec1a 100644 --- a/Userland/Applications/3DFileViewer/main.cpp +++ b/Userland/Applications/3DFileViewer/main.cpp @@ -97,6 +97,7 @@ private: virtual void timer_event(Core::TimerEvent&) override; virtual void mousemove_event(GUI::MouseEvent&) override; virtual void mousewheel_event(GUI::MouseEvent&) override; + virtual void keydown_event(GUI::KeyEvent&) override; private: RefPtr m_mesh; @@ -183,6 +184,14 @@ void GLContextWidget::mousewheel_event(GUI::MouseEvent& event) m_zoom *= 1.1f; } +void GLContextWidget::keydown_event(GUI::KeyEvent& event) +{ + if (event.key() == Key_Escape && window()->is_fullscreen()) { + window()->set_fullscreen(false); + return; + } +} + void GLContextWidget::timer_event(Core::TimerEvent&) { auto timer = Core::ElapsedTimer::start_new();