diff --git a/rpcs3/rpcs3qt/gs_frame.cpp b/rpcs3/rpcs3qt/gs_frame.cpp index 5f968caf6e..d929d0ec0a 100644 --- a/rpcs3/rpcs3qt/gs_frame.cpp +++ b/rpcs3/rpcs3qt/gs_frame.cpp @@ -43,6 +43,7 @@ gs_frame::gs_frame(const QRect& geometry, const QIcon& appIcon, const std::share : QWindow(), m_gui_settings(gui_settings) { m_disable_mouse = gui_settings->GetValue(gui::gs_disableMouse).toBool(); + m_disable_kb_hotkeys = gui_settings->GetValue(gui::gs_disableKbHotkeys).toBool(); m_show_mouse_in_fullscreen = gui_settings->GetValue(gui::gs_showMouseFs).toBool(); m_window_title = qstr(Emu.GetFormattedTitle(0)); @@ -127,16 +128,28 @@ void gs_frame::keyPressEvent(QKeyEvent *keyEvent) if (visibility() == FullScreen) { toggle_fullscreen(); return; } break; case Qt::Key_P: - if (keyEvent->modifiers() == Qt::ControlModifier && Emu.IsRunning()) { Emu.Pause(); return; } + if (keyEvent->modifiers() == Qt::ControlModifier && !m_disable_kb_hotkeys && Emu.IsRunning()) + { + Emu.Pause(); + return; + } break; case Qt::Key_S: - if (keyEvent->modifiers() == Qt::ControlModifier && (!Emu.IsStopped())) { Emu.Stop(); return; } + if (keyEvent->modifiers() == Qt::ControlModifier && !m_disable_kb_hotkeys && (!Emu.IsStopped())) + { + Emu.Stop(); + return; + } break; case Qt::Key_R: - if (keyEvent->modifiers() == Qt::ControlModifier && (!Emu.GetBoot().empty())) { Emu.Restart(); return; } + if (keyEvent->modifiers() == Qt::ControlModifier && !m_disable_kb_hotkeys && (!Emu.GetBoot().empty())) + { + Emu.Restart(); + return; + } break; case Qt::Key_E: - if (keyEvent->modifiers() == Qt::ControlModifier) + if (keyEvent->modifiers() == Qt::ControlModifier && !m_disable_kb_hotkeys) { if (Emu.IsReady()) { Emu.Run(true); return; } else if (Emu.IsPaused()) { Emu.Resume(); return; } diff --git a/rpcs3/rpcs3qt/gs_frame.h b/rpcs3/rpcs3qt/gs_frame.h index aa6ecd8333..ca3e7366bf 100644 --- a/rpcs3/rpcs3qt/gs_frame.h +++ b/rpcs3/rpcs3qt/gs_frame.h @@ -33,6 +33,7 @@ private: u64 m_frames = 0; QString m_window_title; bool m_disable_mouse = false; + bool m_disable_kb_hotkeys = false; bool m_show_mouse_in_fullscreen = false; public: diff --git a/rpcs3/rpcs3qt/gui_settings.h b/rpcs3/rpcs3qt/gui_settings.h index 2cef496ac0..616e1da32a 100644 --- a/rpcs3/rpcs3qt/gui_settings.h +++ b/rpcs3/rpcs3qt/gui_settings.h @@ -191,11 +191,12 @@ namespace gui const gui_save m_discordState = gui_save(meta, "discordState", ""); const gui_save m_check_upd_start = gui_save(meta, "checkUpdateStart", true); - const gui_save gs_disableMouse = gui_save(gs_frame, "disableMouse", false); - const gui_save gs_showMouseFs = gui_save(gs_frame, "showMouseInFullscreen", false); - const gui_save gs_resize = gui_save(gs_frame, "resize", false); - const gui_save gs_width = gui_save(gs_frame, "width", 1280); - const gui_save gs_height = gui_save(gs_frame, "height", 720); + const gui_save gs_disableMouse = gui_save(gs_frame, "disableMouse", false); + const gui_save gs_disableKbHotkeys = gui_save(gs_frame, "disableKbHotkeys", false); + const gui_save gs_showMouseFs = gui_save(gs_frame, "showMouseInFullscreen", false); + const gui_save gs_resize = gui_save(gs_frame, "resize", false); + const gui_save gs_width = gui_save(gs_frame, "width", 1280); + const gui_save gs_height = gui_save(gs_frame, "height", 720); const gui_save tr_icon_color = gui_save(trophy, "icon_color", gl_icon_color); const gui_save tr_icon_height = gui_save(trophy, "icon_height", 75); diff --git a/rpcs3/rpcs3qt/settings_dialog.cpp b/rpcs3/rpcs3qt/settings_dialog.cpp index 2dd5b6a279..93331b88ce 100644 --- a/rpcs3/rpcs3qt/settings_dialog.cpp +++ b/rpcs3/rpcs3qt/settings_dialog.cpp @@ -1265,6 +1265,7 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std { SubscribeTooltip(ui->gs_resizeOnBoot, tooltips.settings.resize_on_boot); SubscribeTooltip(ui->gs_disableMouse, tooltips.settings.disable_mouse); + SubscribeTooltip(ui->gs_disableKbHotkeys, tooltips.settings.disable_kb_hotkeys); SubscribeTooltip(ui->gs_showMouseInFullscreen, tooltips.settings.show_mouse_in_fullscreen); ui->gs_disableMouse->setChecked(m_gui_settings->GetValue(gui::gs_disableMouse).toBool()); @@ -1273,6 +1274,12 @@ settings_dialog::settings_dialog(std::shared_ptr gui_settings, std m_gui_settings->SetValue(gui::gs_disableMouse, val); }); + ui->gs_disableKbHotkeys->setChecked(m_gui_settings->GetValue(gui::gs_disableKbHotkeys).toBool()); + connect(ui->gs_disableKbHotkeys, &QCheckBox::clicked, [this](bool val) + { + m_gui_settings->SetValue(gui::gs_disableKbHotkeys, val); + }); + ui->gs_showMouseInFullscreen->setChecked(m_gui_settings->GetValue(gui::gs_showMouseFs).toBool()); connect(ui->gs_showMouseInFullscreen, &QCheckBox::clicked, [this](bool val) { diff --git a/rpcs3/rpcs3qt/settings_dialog.ui b/rpcs3/rpcs3qt/settings_dialog.ui index 1f663b0f64..58e44b12f0 100644 --- a/rpcs3/rpcs3qt/settings_dialog.ui +++ b/rpcs3/rpcs3qt/settings_dialog.ui @@ -2338,6 +2338,13 @@ + + + + Ignore keyboard hotkeys + + + diff --git a/rpcs3/rpcs3qt/tooltips.h b/rpcs3/rpcs3qt/tooltips.h index a03df31884..5a72e8befe 100644 --- a/rpcs3/rpcs3qt/tooltips.h +++ b/rpcs3/rpcs3qt/tooltips.h @@ -103,6 +103,7 @@ public: const QString resize_on_boot = tr("Automatically resizes the game window on boot.\nThis does not change the internal game resolution."); const QString show_trophy_popups = tr("Show trophy pop-ups when a trophy is unlocked."); const QString disable_mouse = tr("Disables the activation of fullscreen mode per double-click while the game screen is active.\nCheck this if you want to play with mouse and keyboard (for example with UCR)."); + const QString disable_kb_hotkeys = tr("Disables keyboard hotkeys such as Ctrl-S, Ctrl-E, Ctrl-R, Ctrl-P while the game screen is active.\nCheck this if you want to play with mouse and keyboard."); const QString max_llvm_threads = tr("Limits the maximum number of threads used for the initial PPU and SPU module compilation.\nLower this in order to increase performance of other open applications.\nThe default uses all available threads."); const QString show_mouse_in_fullscreen = tr("Shows the mouse cursor when the fullscreen mode is active.\nCurrently this may not work every time."); const QString show_shader_compilation_hint = tr("Show shader compilation hints using the native overlay.");