mirror of
https://github.com/izzy2lost/xenia-edge.git
synced 2026-07-06 00:20:26 -07:00
[UI] Disable all mouse interactions in game window through cvar
This commit is contained in:
@@ -217,9 +217,9 @@ DEFINE_bool(use_gamemode, false,
|
||||
"GameMode must be installed on your system for this to work.",
|
||||
"Linux");
|
||||
#endif
|
||||
DEFINE_bool(disable_doubleclick_fullscreen, false,
|
||||
"Allows the user to disable the behavior where a fast double-click "
|
||||
"causes Xenia to enter fullscreen mode.",
|
||||
DEFINE_bool(disable_game_window_mouse, false,
|
||||
"Disables mouse interactions in the game window, including "
|
||||
"double-click to fullscreen and right-click context menu.",
|
||||
"General");
|
||||
|
||||
namespace xe {
|
||||
@@ -1088,6 +1088,10 @@ void EmulatorWindow::OnKeyDown(ui::KeyEvent& e) {
|
||||
|
||||
void EmulatorWindow::OnMouseDown(const ui::MouseEvent& e) {
|
||||
if (e.button() == ui::MouseEvent::Button::kRight) {
|
||||
if (cvars::disable_game_window_mouse) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If menu is already open, close it instead of opening a new one
|
||||
if (context_menu_widget_qt_) {
|
||||
context_menu_widget_qt_->close();
|
||||
@@ -1229,7 +1233,7 @@ void EmulatorWindow::SaveImage(const std::filesystem::path& filepath,
|
||||
}
|
||||
|
||||
void EmulatorWindow::OnMouseDoubleClick(const ui::MouseEvent& e) {
|
||||
if (cvars::disable_doubleclick_fullscreen) {
|
||||
if (cvars::disable_game_window_mouse) {
|
||||
return;
|
||||
}
|
||||
// Don't toggle fullscreen if any ImGui dialogs are open
|
||||
|
||||
@@ -36,6 +36,8 @@ inline const std::vector<CvarAlias>& GetCvarAliases() {
|
||||
{"render_target_path_d3d12", "rov", "render_target_path", "accuracy"},
|
||||
{"render_target_path_vulkan", "fbo", "render_target_path", "performance"},
|
||||
{"render_target_path_vulkan", "fsi", "render_target_path", "accuracy"},
|
||||
{"disable_doubleclick_fullscreen", "true", "disable_game_window_mouse",
|
||||
"true"},
|
||||
#if XE_PLATFORM_WIN32
|
||||
{"gpu", "any", "gpu", "d3d12"},
|
||||
{"apu", "any", "apu", "xaudio2"},
|
||||
|
||||
Reference in New Issue
Block a user