From 1edd72dc7d1f9e0d080c7ea8cd4167b9fb9ca5ad Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 17 May 2022 21:23:49 -0500 Subject: [PATCH] [nostalgia/studio] Add BaseEditor::keyStateChanged --- src/nostalgia/studio/lib/editor.cpp | 3 +++ src/nostalgia/studio/lib/editor.hpp | 2 ++ src/nostalgia/studio/studioapp.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/src/nostalgia/studio/lib/editor.cpp b/src/nostalgia/studio/lib/editor.cpp index 424b2f96..69807ab3 100644 --- a/src/nostalgia/studio/lib/editor.cpp +++ b/src/nostalgia/studio/lib/editor.cpp @@ -24,6 +24,9 @@ void BaseEditor::paste() { void BaseEditor::exportFile() { } +void BaseEditor::keyStateChanged(core::Key, bool) { +} + void BaseEditor::close() { this->closed.emit(itemName()); } diff --git a/src/nostalgia/studio/lib/editor.hpp b/src/nostalgia/studio/lib/editor.hpp index 11254860..4422b28f 100644 --- a/src/nostalgia/studio/lib/editor.hpp +++ b/src/nostalgia/studio/lib/editor.hpp @@ -48,6 +48,8 @@ class NOSTALGIASTUDIO_EXPORT BaseEditor: public Widget { virtual void exportFile(); + virtual void keyStateChanged(core::Key key, bool down); + void close(); /** diff --git a/src/nostalgia/studio/studioapp.cpp b/src/nostalgia/studio/studioapp.cpp index d3b57e35..d5b3e690 100644 --- a/src/nostalgia/studio/studioapp.cpp +++ b/src/nostalgia/studio/studioapp.cpp @@ -93,6 +93,7 @@ void StudioUI::handleKeyEvent(core::Key key, bool down) noexcept { break; } } + m_activeEditor->keyStateChanged(key, down); } void StudioUI::draw() noexcept {