summaryrefslogtreecommitdiffstats
path: root/src/yuzu/bootmanager.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-11-30 07:59:50 +0100
committerGitHub <noreply@github.com>2020-11-30 07:59:50 +0100
commit7bc3e80399d62aabe4acbba094d0fff23a187186 (patch)
treeac12ca41f34fdda51992fedfeb55b169dedcfcaf /src/yuzu/bootmanager.cpp
parentMerge pull request #5005 from ReinUsesLisp/div-ceil (diff)
parentImplement full mouse support (diff)
downloadyuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.tar
yuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.tar.gz
yuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.tar.bz2
yuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.tar.lz
yuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.tar.xz
yuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.tar.zst
yuzu-7bc3e80399d62aabe4acbba094d0fff23a187186.zip
Diffstat (limited to 'src/yuzu/bootmanager.cpp')
-rw-r--r--src/yuzu/bootmanager.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index ea8f0d7b1..489104d5f 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -35,7 +35,7 @@
#include "core/settings.h"
#include "input_common/keyboard.h"
#include "input_common/main.h"
-#include "input_common/motion_emu.h"
+#include "input_common/mouse/mouse_input.h"
#include "video_core/renderer_base.h"
#include "video_core/video_core.h"
#include "yuzu/bootmanager.h"
@@ -388,23 +388,19 @@ void GRenderWindow::keyReleaseEvent(QKeyEvent* event) {
}
void GRenderWindow::mousePressEvent(QMouseEvent* event) {
- if (!Settings::values.touchscreen.enabled) {
- input_subsystem->GetKeyboard()->PressKey(event->button());
- return;
- }
-
// Touch input is handled in TouchBeginEvent
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
return;
}
auto pos = event->pos();
+ const auto [x, y] = ScaleTouch(pos);
+ input_subsystem->GetMouse()->PressButton(x, y, event->button());
+
if (event->button() == Qt::LeftButton) {
- const auto [x, y] = ScaleTouch(pos);
this->TouchPressed(x, y);
- } else if (event->button() == Qt::RightButton) {
- input_subsystem->GetMotionEmu()->BeginTilt(pos.x(), pos.y());
}
+
QWidget::mousePressEvent(event);
}
@@ -416,26 +412,22 @@ void GRenderWindow::mouseMoveEvent(QMouseEvent* event) {
auto pos = event->pos();
const auto [x, y] = ScaleTouch(pos);
+ input_subsystem->GetMouse()->MouseMove(x, y);
this->TouchMoved(x, y);
- input_subsystem->GetMotionEmu()->Tilt(pos.x(), pos.y());
+
QWidget::mouseMoveEvent(event);
}
void GRenderWindow::mouseReleaseEvent(QMouseEvent* event) {
- if (!Settings::values.touchscreen.enabled) {
- input_subsystem->GetKeyboard()->ReleaseKey(event->button());
- return;
- }
-
// Touch input is handled in TouchEndEvent
if (event->source() == Qt::MouseEventSynthesizedBySystem) {
return;
}
+ input_subsystem->GetMouse()->ReleaseButton(event->button());
+
if (event->button() == Qt::LeftButton) {
this->TouchReleased();
- } else if (event->button() == Qt::RightButton) {
- input_subsystem->GetMotionEmu()->EndTilt();
}
}