mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 14:01:25 +12:00
Qt: Option to disable keyboard hotkeys
This commit is contained in:
parent
edde748519
commit
9a4c26dc8c
6 changed files with 39 additions and 9 deletions
|
@ -43,6 +43,7 @@ gs_frame::gs_frame(const QRect& geometry, const QIcon& appIcon, const std::share
|
||||||
: QWindow(), m_gui_settings(gui_settings)
|
: QWindow(), m_gui_settings(gui_settings)
|
||||||
{
|
{
|
||||||
m_disable_mouse = gui_settings->GetValue(gui::gs_disableMouse).toBool();
|
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_show_mouse_in_fullscreen = gui_settings->GetValue(gui::gs_showMouseFs).toBool();
|
||||||
|
|
||||||
m_window_title = qstr(Emu.GetFormattedTitle(0));
|
m_window_title = qstr(Emu.GetFormattedTitle(0));
|
||||||
|
@ -127,16 +128,28 @@ void gs_frame::keyPressEvent(QKeyEvent *keyEvent)
|
||||||
if (visibility() == FullScreen) { toggle_fullscreen(); return; }
|
if (visibility() == FullScreen) { toggle_fullscreen(); return; }
|
||||||
break;
|
break;
|
||||||
case Qt::Key_P:
|
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;
|
break;
|
||||||
case Qt::Key_S:
|
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;
|
break;
|
||||||
case Qt::Key_R:
|
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;
|
break;
|
||||||
case Qt::Key_E:
|
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; }
|
if (Emu.IsReady()) { Emu.Run(true); return; }
|
||||||
else if (Emu.IsPaused()) { Emu.Resume(); return; }
|
else if (Emu.IsPaused()) { Emu.Resume(); return; }
|
||||||
|
|
|
@ -33,6 +33,7 @@ private:
|
||||||
u64 m_frames = 0;
|
u64 m_frames = 0;
|
||||||
QString m_window_title;
|
QString m_window_title;
|
||||||
bool m_disable_mouse = false;
|
bool m_disable_mouse = false;
|
||||||
|
bool m_disable_kb_hotkeys = false;
|
||||||
bool m_show_mouse_in_fullscreen = false;
|
bool m_show_mouse_in_fullscreen = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -191,11 +191,12 @@ namespace gui
|
||||||
const gui_save m_discordState = gui_save(meta, "discordState", "");
|
const gui_save m_discordState = gui_save(meta, "discordState", "");
|
||||||
const gui_save m_check_upd_start = gui_save(meta, "checkUpdateStart", true);
|
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_disableMouse = gui_save(gs_frame, "disableMouse", false);
|
||||||
const gui_save gs_showMouseFs = gui_save(gs_frame, "showMouseInFullscreen", false);
|
const gui_save gs_disableKbHotkeys = gui_save(gs_frame, "disableKbHotkeys", false);
|
||||||
const gui_save gs_resize = gui_save(gs_frame, "resize", false);
|
const gui_save gs_showMouseFs = gui_save(gs_frame, "showMouseInFullscreen", false);
|
||||||
const gui_save gs_width = gui_save(gs_frame, "width", 1280);
|
const gui_save gs_resize = gui_save(gs_frame, "resize", false);
|
||||||
const gui_save gs_height = gui_save(gs_frame, "height", 720);
|
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_color = gui_save(trophy, "icon_color", gl_icon_color);
|
||||||
const gui_save tr_icon_height = gui_save(trophy, "icon_height", 75);
|
const gui_save tr_icon_height = gui_save(trophy, "icon_height", 75);
|
||||||
|
|
|
@ -1265,6 +1265,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
||||||
{
|
{
|
||||||
SubscribeTooltip(ui->gs_resizeOnBoot, tooltips.settings.resize_on_boot);
|
SubscribeTooltip(ui->gs_resizeOnBoot, tooltips.settings.resize_on_boot);
|
||||||
SubscribeTooltip(ui->gs_disableMouse, tooltips.settings.disable_mouse);
|
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);
|
SubscribeTooltip(ui->gs_showMouseInFullscreen, tooltips.settings.show_mouse_in_fullscreen);
|
||||||
|
|
||||||
ui->gs_disableMouse->setChecked(m_gui_settings->GetValue(gui::gs_disableMouse).toBool());
|
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> gui_settings, std
|
||||||
m_gui_settings->SetValue(gui::gs_disableMouse, val);
|
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());
|
ui->gs_showMouseInFullscreen->setChecked(m_gui_settings->GetValue(gui::gs_showMouseFs).toBool());
|
||||||
connect(ui->gs_showMouseInFullscreen, &QCheckBox::clicked, [this](bool val)
|
connect(ui->gs_showMouseInFullscreen, &QCheckBox::clicked, [this](bool val)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2338,6 +2338,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="gs_disableKbHotkeys">
|
||||||
|
<property name="text">
|
||||||
|
<string>Ignore keyboard hotkeys</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="gs_showMouseInFullscreen">
|
<widget class="QCheckBox" name="gs_showMouseInFullscreen">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
|
@ -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 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 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_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 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_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.");
|
const QString show_shader_compilation_hint = tr("Show shader compilation hints using the native overlay.");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue