From 5e2f08ae67752791c89832890135c24fb9f7e889 Mon Sep 17 00:00:00 2001 From: scawful Date: Sat, 20 Jul 2024 09:03:11 -0400 Subject: [PATCH] Add Open, Save, Quit keyboard shortcuts --- src/app/editor/master_editor.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/app/editor/master_editor.cc b/src/app/editor/master_editor.cc index 9cfe736a..3ef76246 100644 --- a/src/app/editor/master_editor.cc +++ b/src/app/editor/master_editor.cc @@ -273,6 +273,24 @@ void MasterEditor::ManageKeyboardShortcuts() { OpenRomOrProject(front); } } + + // If CMD + Q is pressed, quit the application + if (ImGui::IsKeyDown(ImGuiKey_Q) && + (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + quit_ = true; + } + + // If CMD + O is pressed, open a file dialog + if (ImGui::IsKeyDown(ImGuiKey_O) && + (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + LoadRom(); + } + + // If CMD + S is pressed, save the current ROM + if (ImGui::IsKeyDown(ImGuiKey_S) && + (ImGui::GetIO().KeyCtrl || ImGui::GetIO().KeySuper)) { + SaveRom(); + } } void MasterEditor::DrawFileDialog() {