summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-03-08 08:42:40 +0100
committerbunnei <bunneidev@gmail.com>2015-03-10 23:05:18 +0100
commitf213000cc421a0d00af35e160d9dff9eea617cf6 (patch)
tree4a0af4686f54bb04ae999061a009f8b931be3ec0
parentGLFW: Implemented EmuWindow touchpad support. (diff)
downloadyuzu-f213000cc421a0d00af35e160d9dff9eea617cf6.tar
yuzu-f213000cc421a0d00af35e160d9dff9eea617cf6.tar.gz
yuzu-f213000cc421a0d00af35e160d9dff9eea617cf6.tar.bz2
yuzu-f213000cc421a0d00af35e160d9dff9eea617cf6.tar.lz
yuzu-f213000cc421a0d00af35e160d9dff9eea617cf6.tar.xz
yuzu-f213000cc421a0d00af35e160d9dff9eea617cf6.tar.zst
yuzu-f213000cc421a0d00af35e160d9dff9eea617cf6.zip
-rw-r--r--src/citra_qt/bootmanager.cpp25
-rw-r--r--src/citra_qt/bootmanager.h4
2 files changed, 29 insertions, 0 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index a040e75c1..cf07e65cc 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -278,6 +278,31 @@ void GRenderWindow::keyReleaseEvent(QKeyEvent* event)
Service::HID::PadUpdateComplete();
}
+void GRenderWindow::mousePressEvent(QMouseEvent *event)
+{
+ if (event->button() == Qt::LeftButton) {
+ auto pos = event->pos();
+ EmuWindow::TouchPressed(GetFramebufferLayout(), static_cast<u16>(pos.x()),
+ static_cast<u16>(pos.y()));
+ }
+}
+
+void GRenderWindow::mouseMoveEvent(QMouseEvent *event)
+{
+ auto pos = event->pos();
+ EmuWindow::TouchMoved(GetFramebufferLayout(), static_cast<u16>(pos.x()),
+ static_cast<u16>(pos.y()));
+}
+
+void GRenderWindow::mouseReleaseEvent(QMouseEvent *event)
+{
+ if (event->button() == Qt::LeftButton) {
+ auto pos = event->pos();
+ EmuWindow::TouchReleased(GetFramebufferLayout(), static_cast<u16>(pos.x()),
+ static_cast<u16>(pos.y()));
+ }
+}
+
void GRenderWindow::ReloadSetKeymaps()
{
KeyMap::SetKeyMapping({Settings::values.pad_a_key, keyboard_id}, Service::HID::PAD_A);
diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h
index a55db682a..288da45a1 100644
--- a/src/citra_qt/bootmanager.h
+++ b/src/citra_qt/bootmanager.h
@@ -121,6 +121,10 @@ public:
void keyPressEvent(QKeyEvent* event) override;
void keyReleaseEvent(QKeyEvent* event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+
void ReloadSetKeymaps() override;
void OnClientAreaResized(unsigned width, unsigned height);