From 2f2adbd6aff0818e0d074724f5f5ea6af85edee1 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Sun, 30 Jul 2023 15:24:13 -0500 Subject: [PATCH] VideoCommon: add SHIFT and CTRL keys to be visible to imgui --- Source/Core/DolphinQt/RenderWidget.cpp | 10 +++++----- Source/Core/VideoCommon/OnScreenUI.cpp | 4 ++-- Source/Core/VideoCommon/OnScreenUIKeyMap.h | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/Core/DolphinQt/RenderWidget.cpp b/Source/Core/DolphinQt/RenderWidget.cpp index d88a17e3d3..89a31fd74f 100644 --- a/Source/Core/DolphinQt/RenderWidget.cpp +++ b/Source/Core/DolphinQt/RenderWidget.cpp @@ -574,12 +574,12 @@ void RenderWidget::PassEventToPresenter(const QEvent* event) void RenderWidget::SetPresenterKeyMap() { static constexpr DolphinKeyMap key_map = { - Qt::Key_Tab, Qt::Key_Left, Qt::Key_Right, Qt::Key_Up, Qt::Key_Down, - Qt::Key_PageUp, Qt::Key_PageDown, Qt::Key_Home, Qt::Key_End, Qt::Key_Insert, - Qt::Key_Delete, Qt::Key_Backspace, Qt::Key_Space, Qt::Key_Return, Qt::Key_Escape, + Qt::Key_Tab, Qt::Key_Left, Qt::Key_Right, Qt::Key_Up, Qt::Key_Down, + Qt::Key_PageUp, Qt::Key_PageDown, Qt::Key_Home, Qt::Key_End, Qt::Key_Insert, + Qt::Key_Delete, Qt::Key_Backspace, Qt::Key_Space, Qt::Key_Return, Qt::Key_Escape, Qt::Key_Enter, // Keypad enter - Qt::Key_A, Qt::Key_C, Qt::Key_V, Qt::Key_X, Qt::Key_Y, - Qt::Key_Z, + Qt::Key_Control, Qt::Key_Shift, Qt::Key_A, Qt::Key_C, Qt::Key_V, + Qt::Key_X, Qt::Key_Y, Qt::Key_Z, }; g_presenter->SetKeyMap(key_map); diff --git a/Source/Core/VideoCommon/OnScreenUI.cpp b/Source/Core/VideoCommon/OnScreenUI.cpp index 0e6ff34a7f..609d5fad5f 100644 --- a/Source/Core/VideoCommon/OnScreenUI.cpp +++ b/Source/Core/VideoCommon/OnScreenUI.cpp @@ -453,8 +453,8 @@ void OnScreenUI::SetKeyMap(const DolphinKeyMap& key_map) ImGuiKey_DownArrow, ImGuiKey_PageUp, ImGuiKey_PageDown, ImGuiKey_Home, ImGuiKey_End, ImGuiKey_Insert, ImGuiKey_Delete, ImGuiKey_Backspace, ImGuiKey_Space, ImGuiKey_Enter, ImGuiKey_Escape, ImGuiKey_KeypadEnter, - ImGuiKey_A, ImGuiKey_C, ImGuiKey_V, ImGuiKey_X, - ImGuiKey_Y, ImGuiKey_Z, + ImGuiMod_Ctrl, ImGuiMod_Shift, ImGuiKey_A, ImGuiKey_C, + ImGuiKey_V, ImGuiKey_X, ImGuiKey_Y, ImGuiKey_Z, }; auto lock = GetImGuiLock(); diff --git a/Source/Core/VideoCommon/OnScreenUIKeyMap.h b/Source/Core/VideoCommon/OnScreenUIKeyMap.h index c637f3938b..6e644fef71 100644 --- a/Source/Core/VideoCommon/OnScreenUIKeyMap.h +++ b/Source/Core/VideoCommon/OnScreenUIKeyMap.h @@ -26,6 +26,8 @@ enum class DolphinKey Enter, Escape, KeyPadEnter, + CTRL, + SHIFT, A, // for text edit CTRL+A: select all C, // for text edit CTRL+C: copy V, // for text edit CTRL+V: paste