mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-04 22:25:01 -06:00
Qt: add fullscreen mouse lock setting
This commit is contained in:
parent
d85bb3f4eb
commit
77c191df42
@ -59,6 +59,7 @@ gs_frame::gs_frame(QScreen* screen, const QRect& geometry, const QIcon& appIcon,
|
|||||||
m_disable_mouse = m_gui_settings->GetValue(gui::gs_disableMouse).toBool();
|
m_disable_mouse = m_gui_settings->GetValue(gui::gs_disableMouse).toBool();
|
||||||
m_disable_kb_hotkeys = m_gui_settings->GetValue(gui::gs_disableKbHotkeys).toBool();
|
m_disable_kb_hotkeys = m_gui_settings->GetValue(gui::gs_disableKbHotkeys).toBool();
|
||||||
m_show_mouse_in_fullscreen = m_gui_settings->GetValue(gui::gs_showMouseFs).toBool();
|
m_show_mouse_in_fullscreen = m_gui_settings->GetValue(gui::gs_showMouseFs).toBool();
|
||||||
|
m_lock_mouse_in_fullscreen = m_gui_settings->GetValue(gui::gs_lockMouseFs).toBool();
|
||||||
m_hide_mouse_after_idletime = m_gui_settings->GetValue(gui::gs_hideMouseIdle).toBool();
|
m_hide_mouse_after_idletime = m_gui_settings->GetValue(gui::gs_hideMouseIdle).toBool();
|
||||||
m_hide_mouse_idletime = m_gui_settings->GetValue(gui::gs_hideMouseIdleTime).toUInt();
|
m_hide_mouse_idletime = m_gui_settings->GetValue(gui::gs_hideMouseIdleTime).toUInt();
|
||||||
|
|
||||||
@ -703,7 +704,7 @@ void gs_frame::handle_cursor(QWindow::Visibility visibility, bool from_event, bo
|
|||||||
if (from_event)
|
if (from_event)
|
||||||
{
|
{
|
||||||
// In fullscreen we default to hiding and locking. In windowed mode we do not want the lock by default.
|
// In fullscreen we default to hiding and locking. In windowed mode we do not want the lock by default.
|
||||||
m_mouse_hide_and_lock = visibility == QWindow::Visibility::FullScreen;
|
m_mouse_hide_and_lock = (visibility == QWindow::Visibility::FullScreen) && m_lock_mouse_in_fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the mouse hide timer
|
// Update the mouse hide timer
|
||||||
|
|||||||
@ -46,6 +46,7 @@ private:
|
|||||||
bool m_disable_kb_hotkeys = false;
|
bool m_disable_kb_hotkeys = false;
|
||||||
bool m_mouse_hide_and_lock = false;
|
bool m_mouse_hide_and_lock = false;
|
||||||
bool m_show_mouse_in_fullscreen = false;
|
bool m_show_mouse_in_fullscreen = false;
|
||||||
|
bool m_lock_mouse_in_fullscreen = true;
|
||||||
bool m_hide_mouse_after_idletime = false;
|
bool m_hide_mouse_after_idletime = false;
|
||||||
u32 m_hide_mouse_idletime = 2000; // ms
|
u32 m_hide_mouse_idletime = 2000; // ms
|
||||||
bool m_flip_showed_frame = false;
|
bool m_flip_showed_frame = false;
|
||||||
|
|||||||
@ -207,6 +207,7 @@ namespace gui
|
|||||||
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_disableKbHotkeys = gui_save(gs_frame, "disableKbHotkeys", 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_showMouseFs = gui_save(gs_frame, "showMouseInFullscreen", false);
|
||||||
|
const gui_save gs_lockMouseFs = gui_save(gs_frame, "lockMouseInFullscreen", true);
|
||||||
const gui_save gs_resize = gui_save(gs_frame, "resize", 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_width = gui_save(gs_frame, "width", 1280);
|
||||||
const gui_save gs_height = gui_save(gs_frame, "height", 720);
|
const gui_save gs_height = gui_save(gs_frame, "height", 720);
|
||||||
|
|||||||
@ -1313,6 +1313,7 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|||||||
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_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);
|
||||||
|
SubscribeTooltip(ui->gs_lockMouseInFullscreen, tooltips.settings.lock_mouse_in_fullscreen);
|
||||||
SubscribeTooltip(ui->gs_hideMouseOnIdle_widget, tooltips.settings.hide_mouse_on_idle);
|
SubscribeTooltip(ui->gs_hideMouseOnIdle_widget, tooltips.settings.hide_mouse_on_idle);
|
||||||
|
|
||||||
ui->gs_disableMouse->setChecked(m_gui_settings->GetValue(gui::gs_disableMouse).toBool());
|
ui->gs_disableMouse->setChecked(m_gui_settings->GetValue(gui::gs_disableMouse).toBool());
|
||||||
@ -1333,6 +1334,12 @@ settings_dialog::settings_dialog(std::shared_ptr<gui_settings> gui_settings, std
|
|||||||
m_gui_settings->SetValue(gui::gs_showMouseFs, val);
|
m_gui_settings->SetValue(gui::gs_showMouseFs, val);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ui->gs_lockMouseInFullscreen->setChecked(m_gui_settings->GetValue(gui::gs_lockMouseFs).toBool());
|
||||||
|
connect(ui->gs_lockMouseInFullscreen, &QCheckBox::clicked, [this](bool val)
|
||||||
|
{
|
||||||
|
m_gui_settings->SetValue(gui::gs_lockMouseFs, val);
|
||||||
|
});
|
||||||
|
|
||||||
ui->gs_hideMouseOnIdle->setChecked(m_gui_settings->GetValue(gui::gs_hideMouseIdle).toBool());
|
ui->gs_hideMouseOnIdle->setChecked(m_gui_settings->GetValue(gui::gs_hideMouseIdle).toBool());
|
||||||
connect(ui->gs_hideMouseOnIdle, &QCheckBox::clicked, [this](bool checked)
|
connect(ui->gs_hideMouseOnIdle, &QCheckBox::clicked, [this](bool checked)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2436,6 +2436,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="gs_lockMouseInFullscreen">
|
||||||
|
<property name="text">
|
||||||
|
<string>Lock mouse cursor in Fullscreen</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="gs_hideMouseOnIdle_widget" native="true">
|
<widget class="QWidget" name="gs_hideMouseOnIdle_widget" native="true">
|
||||||
<layout class="QHBoxLayout" name="gs_hideMouseOnIdle_layout" stretch="0,0">
|
<layout class="QHBoxLayout" name="gs_hideMouseOnIdle_layout" stretch="0,0">
|
||||||
|
|||||||
@ -117,6 +117,7 @@ public:
|
|||||||
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.\nThis does not include Ctrl-L (hide and lock mouse) and Alt-Enter (toggle fullscreen).\nCheck this if you want to play with mouse and keyboard.");
|
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.\nThis does not include Ctrl-L (hide and lock mouse) and Alt-Enter (toggle fullscreen).\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 lock_mouse_in_fullscreen = tr("Locks the mouse cursor at center when the fullscreen mode is active.");
|
||||||
const QString hide_mouse_on_idle = tr("Hides the mouse cursor if no mouse movement is detected for the configured time.");
|
const QString hide_mouse_on_idle = tr("Hides the mouse cursor if no mouse movement is detected for the configured time.");
|
||||||
const QString show_shader_compilation_hint = tr("Shows 'Compiling shaders' hint using the native overlay.");
|
const QString show_shader_compilation_hint = tr("Shows 'Compiling shaders' hint using the native overlay.");
|
||||||
const QString use_native_interface = tr("Enables use of native HUD within the game window that can interact with game controllers.\nWhen disabled, regular Qt dialogs are used instead.\nCurrently, the on-screen keyboard only supports the English key layout.");
|
const QString use_native_interface = tr("Enables use of native HUD within the game window that can interact with game controllers.\nWhen disabled, regular Qt dialogs are used instead.\nCurrently, the on-screen keyboard only supports the English key layout.");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user