summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/settings.h2
-rw-r--r--src/input_common/mouse/mouse_poller.cpp2
-rw-r--r--src/yuzu/bootmanager.cpp9
3 files changed, 8 insertions, 5 deletions
diff --git a/src/common/settings.h b/src/common/settings.h
index 832358036..ce1bc647d 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -368,7 +368,7 @@ struct Values {
368 "udp_input_servers"}; 368 "udp_input_servers"};
369 369
370 BasicSetting<bool> mouse_panning{false, "mouse_panning"}; 370 BasicSetting<bool> mouse_panning{false, "mouse_panning"};
371 BasicSetting<u8> mouse_panning_sensitivity{1, "mouse_panning_sensitivity"}; 371 BasicSetting<u8> mouse_panning_sensitivity{10, "mouse_panning_sensitivity"};
372 BasicSetting<bool> mouse_enabled{false, "mouse_enabled"}; 372 BasicSetting<bool> mouse_enabled{false, "mouse_enabled"};
373 std::string mouse_device; 373 std::string mouse_device;
374 MouseButtonsRaw mouse_buttons; 374 MouseButtonsRaw mouse_buttons;
diff --git a/src/input_common/mouse/mouse_poller.cpp b/src/input_common/mouse/mouse_poller.cpp
index 1e84eaddd..efcdd85d2 100644
--- a/src/input_common/mouse/mouse_poller.cpp
+++ b/src/input_common/mouse/mouse_poller.cpp
@@ -84,7 +84,7 @@ public:
84 std::lock_guard lock{mutex}; 84 std::lock_guard lock{mutex};
85 const auto axis_value = 85 const auto axis_value =
86 static_cast<float>(mouse_input->GetMouseState(button).axis.at(axis)); 86 static_cast<float>(mouse_input->GetMouseState(button).axis.at(axis));
87 const float sensitivity = Settings::values.mouse_panning_sensitivity.GetValue() * 0.15f; 87 const float sensitivity = Settings::values.mouse_panning_sensitivity.GetValue() * 0.10f;
88 return axis_value * sensitivity / (100.0f * range); 88 return axis_value * sensitivity / (100.0f * range);
89 } 89 }
90 90
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 7524e3c40..bfae73b60 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -411,8 +411,9 @@ void GRenderWindow::mousePressEvent(QMouseEvent* event) {
411 if (event->source() == Qt::MouseEventSynthesizedBySystem) { 411 if (event->source() == Qt::MouseEventSynthesizedBySystem) {
412 return; 412 return;
413 } 413 }
414 414 // Qt sometimes returns the parent coordinates. To avoid this we read the global mouse
415 auto pos = event->pos(); 415 // coordinates and map them to the current render area
416 const auto pos = mapFromGlobal(QCursor::pos());
416 const auto [x, y] = ScaleTouch(pos); 417 const auto [x, y] = ScaleTouch(pos);
417 const auto button = QtButtonToMouseButton(event->button()); 418 const auto button = QtButtonToMouseButton(event->button());
418 input_subsystem->GetMouse()->PressButton(x, y, button); 419 input_subsystem->GetMouse()->PressButton(x, y, button);
@@ -429,7 +430,9 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
429 if (event->source() == Qt::MouseEventSynthesizedBySystem) { 430 if (event->source() == Qt::MouseEventSynthesizedBySystem) {
430 return; 431 return;
431 } 432 }
432 auto pos = event->pos(); 433 // Qt sometimes returns the parent coordinates. To avoid this we read the global mouse
434 // coordinates and map them to the current render area
435 const auto pos = mapFromGlobal(QCursor::pos());
433 const auto [x, y] = ScaleTouch(pos); 436 const auto [x, y] = ScaleTouch(pos);
434 const int center_x = width() / 2; 437 const int center_x = width() / 2;
435 const int center_y = height() / 2; 438 const int center_y = height() / 2;