aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/bootmanager.cpp
diff options
context:
space:
mode:
authorgerman <german@thesoftwareartisans.com>2021-02-03 12:34:25 -0600
committergerman <german@thesoftwareartisans.com>2021-02-07 20:31:58 -0600
commit52b79ac00965aaf10db1a181067c2f2d33125171 (patch)
tree52ebd5133ac802db77e03d988dced834c833936e /src/yuzu/bootmanager.cpp
parent4a01812ebe3eb7fa593105cf596690731c70a1a9 (diff)
Add mouse panning
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r--src/yuzu/bootmanager.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 4528eb1965..f278f1439a 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -405,12 +405,17 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
return;
}
-
auto pos = event->pos();
const auto [x, y] = ScaleTouch(pos);
- input_subsystem->GetMouse()->MouseMove(x, y);
+ const int center_x = width() / 2;
+ const int center_y = height() / 2;
+ input_subsystem->GetMouse()->MouseMove(x, y, center_x, center_y);
this->TouchMoved(x, y, 0);
+ if (Settings::values.mouse_panning) {
+ QCursor::setPos(mapToGlobal({center_x, center_y}));
+ }
+
emit MouseActivity();
}
@@ -727,6 +732,11 @@ void GRenderWindow::showEvent(QShowEvent* event) {
bool GRenderWindow::eventFilter(QObject* object, QEvent* event) {
if (event->type() == QEvent::HoverMove) {
+ if (Settings::values.mouse_panning) {
+ auto* hover_event = static_cast<QMouseEvent*>(event);
+ mouseMoveEvent(hover_event);
+ return false;
+ }
emit MouseActivity();
}
return false;